Closed michalkvasnicak closed 4 years ago
Now it's fixed by using key
so we rerender example on theme change but the problem is that if you edit the code it won't be used in example on theme change.
Maybe using https://www.gatsbyjs.org/docs/client-only-routes-and-user-authentication/ guide, I should try to make live-preview.tsx
actually contain Router and make Live preview a subroute, maybe this one could help with the problem in dev mode, when sometime examples are not rendered at all.
Ok client side only routes causes infinite redirect problem.
Ok now I need to fix initial load of live preview because it show an error.
I think now it's done. Only thing is that examples with a design system supplied (for example custom theme examples, etc) won't use the color mode because it's based on theme toggling.
Now after the refactor to iframes we've lost support for dark/light theme. We need to send this information to preview and then update it using
window.postMessage()
.