Categorize these components according to whether the hooks within them are used correctly. If they follow the rules of hooks, label them useHookExample; if they don't, label them dontUseHookExample.
Intro to hooks
Give names to the components
Report a typo
Fill in the gaps with the relevant elements
function () {
useEffect(() => {
const [value, setValue] = useState('');
// ...
});
// ...
}class extends React.Component {
useEffect(() => {
const [value, setValue] = useState('');
// ...
});
// ...
}function () {
const [value, setValue] = useState(0);
useEffect(() => {
// ...
}, [value]);
// ...
}Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.