Closed acrazing closed 5 years ago
I see what the problem is.
Would be nice knowing what you saw mate. Just so people who also got this problem can see too ;-)
@KevinOl You need to use babel-plugin-styled-components
or typescript-plugin-styled-components
or typescript-styled-components-plugin
to generate static componentId
to avoid mangle id.
At first: we have 3 async components which would be loaded by
react-loadable
, we call it asc1
,c2
, c3. at server-side, react-loadable load all the components in order, but we only used 2 of them(
c1,
c3) at initial render, which means the
c2is loaded after
c3`, and then, the component id is messed up!Example code:
c1
,c2
,c3
:entry component:
server side code:
We called
await Loadable.preloadAll()
before listen in server side andawait Loadable.preloadReady()
before hydrate in client side. Just as you would expect, server side logsin order, and client side logs:
And then, the class name of
M3Root
becomes the class name ofM2Root
, react throws the warning: