React - Hooks can only be called with function component

0 votes
80 views
added Aug 23, 2022 in React by lcjr First Warrant Officer (9,190 points)
import Link from 'next/link';
import { css, jsx } from '@emotion/react';

function FunctionComponent() {
  const [isActive, setIsActive] = useState(false);
 
  const handleClick = event => {
    // toggle isActive state on click
    setIsActive(current => !current);
  };
return ( 
      // your code is here
);
}
export default FunctionComponent;

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...