Plans to support Next.js 13 - /app directory
See original GitHub issueThe problem
Next JS just release their v13 publicly.
As seen in their docs, emotion
has not yet added support.
Is there any plan to add support in the near future?
Thanks.
Issue Analytics
- State:
- Created a year ago
- Reactions:154
- Comments:41 (10 by maintainers)
Top Results From Across the Web
App Directory Roadmap - Next.js beta docs
Section Feature Supported
React 18 Server Components ✓ Default
React 18 Client Components ✓ Opt‑in
React 18 Shared Components 🏗️
Read more >i18n with Next.js 13 and app directory - DEV Community
js 13 which introduced the new app directory. It includes support for Layouts, Server Components, Streaming and Support for Data Fetching.
Read more >NextJS 13 - First Look at the /app Folder & Complete Demo
NextJS 13 introduces the beta version of the brand-new / app folder support. This folder allows you to build NextJS apps in a...
Read more >Next.js 13: Working with the new app directory - LogRocket Blog
While still supporting the same file system-based routing, which uses the pages directory, the new app directory introduces the concepts of ...
Read more >How the App Directory Works in Next.js 13 - MakeUseOf
Next.js 13 introduced a new routing system using the app directory. Next.js 12 already provided an easy way of handling routes through ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We may want to add an explicit API for this but this works today:
After talking with the Next.js team and helping them recognize the problem with
useServerInsertedHTML
andSuspense
that issue has been fixed in https://github.com/vercel/next.js/pull/42293With that fix Emotion roughly works in the
/app
if you do this:(kudos to the @emmatown for providing this implementation)
We need to figure out the exact APIs for handling this within Emotion but conceptually the thing would end up being very similar - you just won’t have to override
cache.insert
in the future and we’ll provide this new kind of theflush
in Emotion itself.Note that you should only use Emotion with the so-called client components (we might add
"use client";
directive to our files to make this obvious). They can render on the server just fine - for the initial SSRed/streamed HTML but server “refetches” won’t render them on the server, they might be rendered on the client when the “refetch” response comes back. This is not Emotion’s limitation - it’s a limitation for all CSS-in-JS libs like Emotion (including Styled Components, styled-jsx and more)