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
When using the sandpack provider in a Nextjs 13/14 (app directory) context, I found that the theme (and other props) do not trigger a rerender when they change.
I suspect that this has something to do with nextjs' new App dir and RSCs, however it could also be possible that props are being heavily cached inside of sandpack itself.
What were you doing when the problem occurred?
Updated the state of the SandpackProvider via useState in nextjs
What steps can we take to reproduce the problem?
npx create-next-app@latest
Copy the code from this sandbox into a client component
danieldelcore
changed the title
SandpackProvider not updated when props change on NextJS 13/14
SandpackProvider not triggering rerenders when props change on NextJS 13/14
Feb 9, 2024
In fact this might be reproducible on the website. I could have sworn this theme switcher updated the color scheme of the editor but now it looks like it does nothing 🤔
Bug report
Packages affected
Description of the problem
When using the sandpack provider in a Nextjs 13/14 (app directory) context, I found that the theme (and other props) do not trigger a rerender when they change.
Here's the code for a repro but note this is only visible when using nextjs.
https://codesandbox.io/p/sandbox/dank-wood-9gtfp5?file=%2Fsrc%2FApp.tsx%3A23%2C51
I suspect that this has something to do with nextjs' new App dir and RSCs, however it could also be possible that props are being heavily cached inside of sandpack itself.
What were you doing when the problem occurred?
Updated the state of the SandpackProvider via useState in nextjs
What steps can we take to reproduce the problem?
npx create-next-app@latest
Link to sandbox: link
Your Environment
The text was updated successfully, but these errors were encountered: