react-live icon indicating copy to clipboard operation
react-live copied to clipboard

Fix SSR regression

Open jpdriver opened this issue 2 years ago • 2 comments

  • 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.

jpdriver avatar May 12 '22 21:05 jpdriver

Thanks for reporting. I'll come with an PR.

tujoworker avatar May 25 '22 10:05 tujoworker

@jpdriver and @rilakumma Are you able to look at the PR?

tujoworker avatar May 27 '22 21:05 tujoworker