react-live
react-live copied to clipboard
Fix SSR regression
- versions prior to 2.3.0 supported SSR
- we inadvertently lost this functionality in https://github.com/FormidableLabs/react-live/pull/226
- see also https://github.com/FormidableLabs/react-live/issues/272#issuecomment-1022716148
we need to refactor <LiveProvider />
to avoid relying on useEffect
(which does not run on the server because it only runs after each render)
we also have a useState
hook that gets initialized with empty values. The refactor should make transpileAsync()
callable in both the useEffect
hook and the useState
initializer.
Thanks for reporting. I'll come with an PR.
@jpdriver and @rilakumma Are you able to look at the PR?