【发布时间】:2020-12-05 22:55:23
【问题描述】:
test('check if home renders correctly', () => {
const { getByText } = render( <MockedProvider mocks={mocks} addTypename={false}> <Home/> </MockedProvider>);
});
我在 MockedProvider 下面有一条红线,带有错误消息:
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string
| ... | (new (props: any) => Component<any, any, any>)> | null) | (new
(props: any) => Component<any, any, any>)> | ... 7 more ... |
undefined'.
【问题讨论】:
标签: reactjs typescript graphql react-apollo apollo-client