How do you use React.js for SEO?

前端 未结 6 1235
星月不相逢
星月不相逢 2021-01-30 01:34

Articles on React.js like to point out, that React.js is great for SEO purposes. Unfortunately, I\'ve never read, how you actually do it. Do you simply implement _escaped_

6条回答
  •  一整个雨季
    2021-01-30 02:00

    It is also possible via ReactDOMServer.renderToStaticMarkup:

    Similar to renderToString, except this doesn't create extra DOM attributes such as data-react-id, that React uses internally. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save lots of bytes.

提交回复
热议问题