Which are incorrect?

Report a typo

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.

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