ml-in-barcelona / server-reason-react

Server render Reason React components with OCaml natively
https://ml-in-barcelona.github.io/server-reason-react/local/server-reason-react/index.html
MIT License
133 stars 8 forks source link

Remove data-reactroot attr from ReactDom render_element #129

Closed pedrobslisboa closed 6 months ago

pedrobslisboa commented 6 months ago

Related Issue https://github.com/ml-in-barcelona/server-reason-react/issues/126

Motivation

The data-reactroot was available before v18 when calling renderToString, but react removed it. It can be checked by seeing that renderToString doesn't return a string element with data-reactroot at this test: https://github.com/facebook/react/blob/ed3c65caf042f75fe2fdc2a5e568a9624c6175fb/packages/react-dom/src/__tests__/ReactServerRendering-test.js#L4

The commit which removed that is this one: https://github.com/facebook/react/commit/940f48b999a3131e77b2545bd7ae252ef27ae6d1

What this PR does

Checklist

image

davesnx commented 6 months ago

Super good @pedrobslisboa