You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what it appears one is unable to to currently use any component utilizing hooks with x0 when producing the static website. This works wonderfully via webpack dev server yarn xo docs.
After much digging I have determined that the code base is indeed using the same react versions 16.8.6 everywhere. However, the trip is that react is pre-bundled from within the webpack bundle. Therefore when build.js is calling react-dom/serverrenderToString they are not utilizing the same React memory instance as webpack (client side) and server side (build.js) have their own. This yields to the client side's React never getting ReactSharedInternals being set which in turn yields the null hook dispatcher.
The only possible work around I can think of is forcing react and react-dom to be external resources. via
First off amazing library!
From what it appears one is unable to to currently use any component utilizing hooks with
x0
when producing the static website. This works wonderfully via webpack dev serveryarn xo docs
.After much digging I have determined that the code base is indeed using the same react versions
16.8.6
everywhere. However, the trip is that react is pre-bundled from within the webpack bundle. Therefore whenbuild.js
is callingreact-dom/server
renderToString
they are not utilizing the sameReact
memory instance as webpack (client side) and server side (build.js) have their own. This yields to the client side's React never getting ReactSharedInternals being set which in turn yields the null hook dispatcher.The only possible work around I can think of is forcing
react
andreact-dom
to be external resources. viaBut with this accomplished how do we inject / eval the server side (build.js) version of react into the webpack bundle.
I will happily provide more details if needed.
As a side not this is specifically related to many issues which resolve to facebook/react#14022 .
The text was updated successfully, but these errors were encountered: