Can i have two React render? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can i have two React render?

Example: ReactDOM.render(<Navbar />, document.querySelector('.navba-tag')) ReactDOM.render(<BoxContent />, dacument.querySelector('.content-container'))

27th Oct 2021, 4:48 AM
EsaKurniawan
2 Answers
+ 3
The below mentioned link might be helpful to you. https://stackoverflow.com/questions/31302803/is-it-ok-to-use-react-render-multiple-times-in-the-dom#:~:text=Yes%2C%20it%20is%20perfectly%20fine,instance%20independent%20of%20any%20others. Further, there is a typo in your question, you have typed dacument instead of document.
27th Oct 2021, 4:55 AM
Art1mis
0
Yes, you can, but should be only for independent components which not gonna to communicate with each other.
27th Oct 2021, 12:03 PM
Calviղ
Calviղ - avatar