Hejka, czy może mi ktoś wyjaśnić czemu mi nie działa ten hook do przypisania name w sendForm.js. Dostaje taki komunikat
React Hook "useState" is called in function "sendForm" which is neither a React function component or a custom React Hook function react-hooks/rules-of-hooks
SendForm.js
import React, { useState } from 'react';
import '../Style/sendForm.css'
const sendForm = () => {
const [name, setName] = useState('Mary');
return (
<form className="form">
<input type='text' />
</form>
);
}
export default sendForm;
App.js
import React, { Component, useState } from 'react';
import './Style/App.css'
import Form from './Components/sendForm'
import sendForm from './Components/sendForm';
const App = () => {
return (
<div className="App">
<h1 className='header'>Rick and Morty<br />Information</h1>
<section className="section">
<div className="section__left">
<sendForm />
</div>
<div className="section__right">
</div>
</section>
</div >
);
}
export default App;