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
This is more of a question than a bug. My current setup is that I'm using Vite in SSR mode. I have a custom client and custom server that render an App component. I've followed the Emotion SSR docs to add a custom cache that works great. My issue though is that if there is a component (Chakra in this case) that is ONLY rendered client side, the CSS for it does not get added to the cache. Here is some pseudocode of my setup:
// app.tsx
export const App = () => {
return (
<ChakraProvider>
// This only renders client side and is the issue. If I remove this conditional to make the Menu render server side too then all is well
{!getRuntime().isServerSide && (
<Menu>
<MenuButton as={Button} rightIcon={<ChevronDownIcon />}>
Actions
</MenuButton>
<MenuList>
<MenuItem>1</MenuItem>
<MenuItem>2</MenuItem>
</MenuList>
</Menu>
)}
</ChakraProvider>
</>
);
}
Is there a way for the styles to work properly in this SSR but client side-only context?
The text was updated successfully, but these errors were encountered:
This is more of a question than a bug. My current setup is that I'm using Vite in SSR mode. I have a custom client and custom server that render an App component. I've followed the Emotion SSR docs to add a custom cache that works great. My issue though is that if there is a component (Chakra in this case) that is ONLY rendered client side, the CSS for it does not get added to the cache. Here is some pseudocode of my setup:
Is there a way for the styles to work properly in this SSR but client side-only context?
The text was updated successfully, but these errors were encountered: