File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed
tests/fixture/skip/multiple-exports Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -610,9 +610,6 @@ impl NextSuperJsonTransformer {
610610 let mut first = None ;
611611
612612 items. iter_mut ( ) . enumerate ( ) . any ( |( pos, item) | {
613- // check initial props
614- item. visit_mut_children_with ( self ) ;
615-
616613 let found = match item {
617614 // check has ssg props
618615 ModuleItem :: ModuleDecl ( ModuleDecl :: ExportDecl ( ExportDecl { decl, .. } ) ) => {
@@ -666,7 +663,7 @@ impl NextSuperJsonTransformer {
666663 } ;
667664
668665 if found {
669- if first. is_some ( ) || self . use_init_props {
666+ if first. is_some ( ) {
670667 self . has_multiple_props = true ;
671668 return true ;
672669 }
@@ -680,6 +677,13 @@ impl NextSuperJsonTransformer {
680677 return ;
681678 }
682679
680+ // check initial props
681+ if first. is_none ( ) {
682+ items
683+ . iter_mut ( )
684+ . for_each ( |item| item. visit_mut_children_with ( self ) ) ;
685+ }
686+
683687 self . props . export . orig = first;
684688
685689 if ssg_prop_ident. is_some ( ) && !self . props . skip {
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ export default function Page() {
22 return < div > Page</ div > ;
33}
44
5+ Page . getInitialProps = ( ) => {
6+ return { } ;
7+ }
8+
59export const getStaticProps = ( ) => {
610 return {
711 props : { } ,
@@ -12,8 +16,4 @@ export const getServerSideProps = () => {
1216 return {
1317 props : { } ,
1418 } ;
15- }
16-
17- Page . getInitialProps = ( ) => {
18- return { } ;
1919}
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ export default function Page() {
22 return < div > Page</ div > ;
33}
44
5+ Page . getInitialProps = ( ) => {
6+ return { } ;
7+ }
8+
59export const getStaticProps = ( ) => {
610 return {
711 props : { } ,
@@ -12,8 +16,4 @@ export const getServerSideProps = () => {
1216 return {
1317 props : { } ,
1418 } ;
15- }
16-
17- Page . getInitialProps = ( ) => {
18- return { } ;
1919}
You can’t perform that action at this time.
0 commit comments