React - Hooks can only be called with function component

0 votes
194 views
added Aug 23, 2022 in React by lcjr First Warrant Officer (11,790 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.
...