@@ -137,7 +137,7 @@ function forEachHikeElementMoveChildrenToHikeProp(root: any, jsxOn: boolean) {
137
137
visit ( root , ( node : any ) => {
138
138
if ( isElementWithHikeAttribute ( node , jsxOn ) ) {
139
139
if ( jsxOn ) {
140
- moveChildrenToHikePropJSX ( node , jsxOn )
140
+ moveChildrenToHikePropJSX ( node )
141
141
} else {
142
142
moveChildrenToHikeProp ( node )
143
143
}
@@ -157,7 +157,7 @@ function isElementWithHikeAttribute(node: any, jsxOn: boolean) {
157
157
)
158
158
}
159
159
160
- function moveChildrenToHikePropJSX ( node : any , jsxOn : boolean ) {
160
+ function moveChildrenToHikePropJSX ( node : any ) {
161
161
// dictionary of children by path
162
162
const childrenByPath : any = { }
163
163
node . children . forEach ( ( slot : any ) => {
@@ -252,8 +252,8 @@ function moveChildrenToHikeProp(node: any) {
252
252
( p : any ) => p . key . name !== "children" ,
253
253
)
254
254
255
- // jsxs calls can only have arrays as children, so we turn any jsxs without array into jsx call
256
255
visit ( node , function ( node : any ) {
256
+ // jsxs calls can only have arrays as children, so we turn any jsxs without array into jsx call
257
257
if ( node . type === "CallExpression" && node . callee . name === "_jsxs" ) {
258
258
const childrenProp = node . arguments [ 1 ] . properties . find (
259
259
( p : any ) => p . key . value === "children" ,
@@ -262,6 +262,16 @@ function moveChildrenToHikeProp(node: any) {
262
262
node . callee . name = "_jsx"
263
263
}
264
264
}
265
+
266
+ // same, but in dev mode the name is _jsxDEV, and we should change the `isStaticChildren` argument
267
+ if ( node . type === "CallExpression" && node . callee . name === "_jsxDEV" ) {
268
+ const childrenProp = node . arguments [ 1 ] . properties . find (
269
+ ( p : any ) => p . key . value === "children" ,
270
+ )
271
+ if ( childrenProp && childrenProp . value . type !== "ArrayExpression" ) {
272
+ node . arguments [ 3 ] = { type : "Literal" , value : false }
273
+ }
274
+ }
265
275
} )
266
276
}
267
277
0 commit comments