Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Warning: Internal React error: Expected static flag was missing. Please notify the React team.

//If condition must be after useEffet()
// error
const C = () =>  {
    if (condition) return null;
    useEffect(() => {/*...*/}, []);
    return <div></div>
}

//no error
const C = () =>  {
    useEffect(() => {/*...*/}, []);
    if (condition) return null;
    return <div></div>
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #Internal #React #Expected #static #flag #Please #notify #React
ADD COMMENT
Topic
Name
9+8 =