skip to Main Content

Javascript – React useEffect dependency

import React from "react"; export default function TestComponent(){ const [booValue, setBoolValue] = React.useState(false) React.useEffect(() => { setBoolValue(!booValue); },[]) React.useEffect(() => { console.log('booValue is', booValue) },[booValue]) return ( <></> ) } What to do not to print twice. Its not in…

VIEW QUESTION
Back To Top
Search