Here are four untitled function components. If a function adheres to the rules of hooks, name it useHookExample, and if it employs hooks improperly, name it dontUseHookExample.
Intro to hooks
Which are incorrect?
Report a typo
Fill in the gaps with the relevant elements
function () {
const [value, setValue] = useState(0);
useEffect(() => {
setCount(value + 1);
}, [value]);
// ...
}function () {
const [value, setValue] = useState(0);
const increment = () => {
setCount(value + 1);
};
// ...
}function () {
const [data, setData] = useState(null);
useEffect(() => {
// ...
}, []);
// ...
};function () {
if (condition) {
const [value, setValue] = useState('');
// ...
}
// ...
}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.