I am running into a few issues around the Server Components in Next 13 using the app directory.
Since I use a theme provider in my root layout, I get the following error if I don't add use client to all my pages:
TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component
But with adding use client to all my pages I can then not use the new metadata object or generateMetadata function, as I get
The Next.js 'metadata' API is not allowed in a client component.
I feel like I must be missing something, but so far it seems like opting out of server rendered components seems to be required for all of my pages and my layout due to the use of context, state and/or effects. What am I missing?