I am new to React and Now I would like to show some record in the table and now I got this error. Help me, please.
Invalid hook call. Hooks can only b
My case.... SOLUTION in HOOKS
const [cep, setCep] = useState(''); const mounted = useRef(false); useEffect(() => { if (mounted.current) { fetchAPI(); } else { mounted.current = true; } }, [cep]); const setParams = (_cep) => { if (cep !== _cep || cep === '') { setCep(_cep); } };