Friday, 14 July 2023

Solution Error : validateDOMNesting body cannot appear as a child of

 Today I will try to share how to solving and solution error "validateDOMNesting body cannot appear as a child of ",  There are so many things that cause this problem,  but for my situation, I can solve this problem like example scripts below :

                <body>

                {/*<!-- ======= Header ======= -->*/}
                <header id="header" className="fixed-top ">
                    <div className="container d-flex align-items-center">
                    </div>
                </header>
                </body>

The script above sometimes resulting the error "validateDOMNesting body".

To solve this error, just remove tag <body> </body> in JSX,  like the script below :

                 <header id="header" className="fixed-top ">
                    <div className="container d-flex align-items-center">
                    </div>
                </header> 


That is just a little information and hope can be helping you. Thanks

No comments:

Post a Comment