That happens because a ReactJS is rendered using JS. It means that the DOM will be updated using JS. When you open it with ctrl + U you’re looking only to the HTML document, without any changes made by the JS engine.
I don’t think leaving it like this will affect SEO, but you you can use server-side rendering to achieve what you want.
it’s happening because the jsx we write are actually closer to js than html,
after we ship the code the we send the js and only the root div.
as the js executes in browser the div gets populated.
now it has effects on SEO,
you won’t get any preview of your website if you share it on any social media if you go with raw react.
if it’s a blog, or some documentation page I would suggest you look up static generation or server-side rendering and go with nextjs or gatsbyjs.
2
Answers
That happens because a ReactJS is rendered using JS. It means that the DOM will be updated using JS. When you open it with ctrl + U you’re looking only to the HTML document, without any changes made by the JS engine.
I don’t think leaving it like this will affect SEO, but you you can use server-side rendering to achieve what you want.
it’s happening because the jsx we write are actually closer to js than html,
after we ship the code the we send the js and only the root div.
as the js executes in browser the div gets populated.
now it has effects on SEO,
you won’t get any preview of your website if you share it on any social media if you go with raw react.
if it’s a blog, or some documentation page I would suggest you look up static generation or server-side rendering and go with nextjs or gatsbyjs.