55 * 2.0.
66 */
77
8- import React , { ReactElement } from 'react' ;
8+ import React , { PropsWithChildren , ReactElement } from 'react' ;
99import { ReactWrapper } from 'enzyme' ;
1010import { mountWithIntl as mount } from '@kbn/test-jest-helpers' ;
1111import { Provider } from 'react-redux' ;
@@ -80,9 +80,7 @@ export const renderWithReduxStore = (
8080
8181 const CustomWrapper = wrapper as React . ComponentType ;
8282
83- const Wrapper : React . FC < {
84- children : React . ReactNode ;
85- } > = ( { children } ) => {
83+ const Wrapper : React . FC < PropsWithChildren < { } > > = ( { children } ) => {
8684 return (
8785 < Provider store = { store } >
8886 < I18nProvider >
@@ -135,9 +133,7 @@ export const mountWithProvider = async (
135133 component : React . ReactElement ,
136134 store ?: MountStoreProps ,
137135 options ?: {
138- wrappingComponent ?: React . FC < {
139- children : React . ReactNode ;
140- } > ;
136+ wrappingComponent ?: React . FC < PropsWithChildren < { } > > ;
141137 wrappingComponentProps ?: Record < string , unknown > ;
142138 attachTo ?: HTMLElement ;
143139 }
@@ -156,18 +152,16 @@ const getMountWithProviderParams = (
156152 component : React . ReactElement ,
157153 store ?: MountStoreProps ,
158154 options ?: {
159- wrappingComponent ?: React . FC < {
160- children : React . ReactNode ;
161- } > ;
155+ wrappingComponent ?: React . FC < PropsWithChildren < { } > > ;
162156 wrappingComponentProps ?: Record < string , unknown > ;
163157 attachTo ?: HTMLElement ;
164158 }
165159) => {
166160 const { store : lensStore , deps } = makeLensStore ( store || { } ) ;
167161
168- let wrappingComponent : React . FC < {
169- children : React . ReactNode ;
170- } > = ( { children } ) => < Provider store = { lensStore } > { children } </ Provider > ;
162+ let wrappingComponent : React . FC < PropsWithChildren < { } > > = ( { children } ) => (
163+ < Provider store = { lensStore } > { children } </ Provider >
164+ ) ;
171165
172166 let restOptions : {
173167 attachTo ?: HTMLElement | undefined ;
@@ -177,7 +171,7 @@ const getMountWithProviderParams = (
177171 restOptions = rest ;
178172
179173 if ( _wrappingComponent ) {
180- wrappingComponent = ( { children } : { children ?: React . ReactNode } ) => {
174+ wrappingComponent = ( { children } ) => {
181175 return _wrappingComponent ( {
182176 ...wrappingComponentProps ,
183177 children : < Provider store = { lensStore } > { children } </ Provider > ,
0 commit comments