fix(nextjs): styled-jsx and styled-components should have "use client directive" (#16440)
This commit is contained in:
parent
fb54f67581
commit
5e0893a38f
@ -401,7 +401,7 @@ describe('app', () => {
|
|||||||
{},
|
{},
|
||||||
`
|
`
|
||||||
[
|
[
|
||||||
"plugin:@nx/nx/react-typescript",
|
"plugin:@nx/react-typescript",
|
||||||
"next",
|
"next",
|
||||||
"next/core-web-vitals",
|
"next/core-web-vitals",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
<% if (styledModule && (styledModule === 'styled-jsx' || styledModule === 'styled-components')) {%>
|
||||||
|
'use client';
|
||||||
|
<% }%>
|
||||||
<% if (styledModule && styledModule !== 'styled-jsx') {
|
<% if (styledModule && styledModule !== 'styled-jsx') {
|
||||||
var wrapper = 'StyledPage';
|
var wrapper = 'StyledPage';
|
||||||
%>import styled from '<%= styledModule %>';<% } else {
|
%>import styled from '<%= styledModule %>';<% } else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user