fix(nextjs): styled-jsx and styled-components should have "use client directive" (#16440)

This commit is contained in:
Nicholas Cunningham 2023-04-20 12:35:25 -06:00 committed by GitHub
parent fb54f67581
commit 5e0893a38f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -401,7 +401,7 @@ describe('app', () => {
{},
`
[
"plugin:@nx/nx/react-typescript",
"plugin:@nx/react-typescript",
"next",
"next/core-web-vitals",
]

View File

@ -1,3 +1,6 @@
<% if (styledModule && (styledModule === 'styled-jsx' || styledModule === 'styled-components')) {%>
'use client';
<% }%>
<% if (styledModule && styledModule !== 'styled-jsx') {
var wrapper = 'StyledPage';
%>import styled from '<%= styledModule %>';<% } else {