diff --git a/CHANGELOG.md b/CHANGELOG.md index c18c8d5a647..5bca18d5a0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ - Maintain serial ordering of `asyncMap` mapping function calls, and prevent potential unhandled `Promise` rejection errors.
[@benjamn](https://github.com/benjamn) in [#7818](https://github.com/apollographql/apollo-client/pull/7818) +- Remove `children` type override in MockedProviderProps
+ [@kevinperaza](https://github.com/kevinperaza) in [#7833](https://github.com/apollographql/apollo-client/pull/7833) + ## Apollo Client 3.3.11 ### Bug fixes diff --git a/src/utilities/testing/mocking/MockedProvider.tsx b/src/utilities/testing/mocking/MockedProvider.tsx index 5612a0f53c5..3813b63fcd4 100644 --- a/src/utilities/testing/mocking/MockedProvider.tsx +++ b/src/utilities/testing/mocking/MockedProvider.tsx @@ -15,7 +15,7 @@ export interface MockedProviderProps { cache?: ApolloCache; resolvers?: Resolvers; childProps?: object; - children?: React.ReactElement; + children?: any; link?: ApolloLink; } @@ -57,7 +57,7 @@ export class MockedProvider extends React.Component< public render() { const { children, childProps } = this.props; - return children ? ( + return React.isValidElement(children) ? ( {React.cloneElement(React.Children.only(children), { ...childProps })}