File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 8
8
* @flow strict-local
9
9
*/
10
10
11
- import React , { Children , ReactElement , ReactNode } from 'react' ;
11
+ import React , { Children , ReactNode , ReactElement } from 'react' ;
12
12
13
13
export const childrenWithOverriddenStyle = ( children ?: ReactNode ) => {
14
14
// Override styles so that each page will fill the parent. Native component
15
15
// will handle positioning of elements, so it's not important to offset
16
16
// them correctly.
17
17
return Children . map ( children , ( child ) => {
18
- const { props, type } = child as ReactElement ;
18
+ const { props } = child as ReactElement ;
19
19
const newProps = {
20
20
...props ,
21
21
style : [
@@ -32,6 +32,6 @@ export const childrenWithOverriddenStyle = (children?: ReactNode) => {
32
32
] ,
33
33
collapsable : false ,
34
34
} ;
35
- return React . createElement ( type , newProps ) ;
35
+ return React . cloneElement ( child as ReactElement , newProps ) ;
36
36
} ) ;
37
37
} ;
You can’t perform that action at this time.
0 commit comments