kmoskwiak / useSSE

use Server-Side Effect ✨in React SSR app
https://kspr.dev/use-sse/
MIT License
139 stars 10 forks source link

Issue with component rendering #13

Open tomexx opened 3 years ago

tomexx commented 3 years ago

Hi, first of all, thank you for the repo!

Secondly, I tried to use the repo with Razzle SSR. The server part works correctly but I have issue on frontend part. The components with useSSE seems to render correctly, but they rerender again while FE init so there is visible blinking (the API call from useSSE is fired again on FE, trying to reach the same data that are already rendered by server). Are you aware of this, is it a known issue?

Thanks a lot

kmoskwiak commented 3 years ago

Hi, I never worked with Razzle. Are you able to provide an example code?

osvarychevskyi commented 3 years ago

Hi,

I am using the custom server side rendering with webpack and I can confirm that I have the same issue.

The api request is triggered again on the client side despite the data is rendered and delivered from.

JulianSoto commented 2 years ago

Did you declare const { ServerDataContext, resolveData } = createServerContext() inside your express middleware/controller?