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
In other cases, merely importing a library causes the app to crash because that library depends on something like web workers which don't exist in Node. I'm exploring code like this to work around it:
I love the SSR and don't want to stop using it, however I feel like we can maybe make client-side less painful as well. Some ideas I had:
Allow some setting in ssr.tsx to force client-side a component via path like: clientOnly: ['./app/components/blah.tsx', '@deck.gl/core']. This can cause layout shift, but that might be fine.
Tap into the router to set routes that are SPA and others that are SSR. This is kinda cool with nested routes, you can get really close to the component level.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been working with the new Start framework for a few days now while I love it, a painful aspect is dealing with client-side code.
In some cases, I can wrap a component (like plotly.js) with a useEffect hook like this:
In other cases, merely importing a library causes the app to crash because that library depends on something like web workers which don't exist in Node. I'm exploring code like this to work around it:
I love the SSR and don't want to stop using it, however I feel like we can maybe make client-side less painful as well. Some ideas I had:
ssr.tsx
to force client-side a component via path like:clientOnly: ['./app/components/blah.tsx', '@deck.gl/core']
. This can cause layout shift, but that might be fine.use client;
? https://react.dev/reference/rsc/use-clientAny advice or thoughts on how to deal with these issues on a per case or framework level is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions