Next.js Discord

Discord Forum

chakraui server/client sided rendering

Answered
Luan posted this in #help-forum
Open in Discord
ChakraUI only works with client sided rendering.

is there a easier way to combine server- and clientsided rendering besides, exporting the component which uses clientsided rendering and importing the component to a serversided rendered page
Answered by riský
that seems to be the only way (esp when you want metadata)
View full answer

15 Replies

that seems to be the only way (esp when you want metadata)
Answer
an alternative is make a file that exports things from the ui
and import if into the server comp
@riský that seems to be the only way (esp when you want metadata)
in nextjs 13 ther isnt really another way to add a title right?
depending on if the library is nice, they will add 'use client' to their exports, but idk
so my solution for this is create a client compoent that imports your ui components and then directly exports them
i would advice against doing that unless you have to
like if user input needs to change the title
otherwise you should use server component
ah well fair enough, then ill leave it the way it already was ig
thank you tho
yeah and with you using nextjs router import, it also makes it a bit harder (you can create that in a diferent component tho)
but glad to try to assist you (and sorry for not a better solution)