Using: "@testing-library/react": "^9.1.4",
If I call:
render({component})
Where component is:
{ '$$typeof': Symbol(react.element),
type:
{ mapStateToProps: [Function],
mapDispatchToProps: [Function: mapDispatchToProps],
reactComponent: { [Function: WithHandlers] displayName: 'withHandlers(lifecycle(Component))' },
mockDispatch:
{ [Function: mockConstructor]
_isMockFunction: true,
getMockImplementation: [Function],
mock: [Getter/Setter],
mockClear: [Function],
mockReset: [Function],
mockReturnValueOnce: [Function],
mockReturnValue: [Function],
mockImplementationOnce: [Function],
mockImplementation: [Function],
mockReturnThis: [Function],
mockRestore: [Function] } },
key: null,
ref: null,
props: {},
_owner: null,
_store: {} }
I get this error:
console.error node_modules/react/cjs/react.development.js:172 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
If I render this component there is no error:
{ '$$typeof': Symbol(react.element),
type: [Function],
key: null,
ref: null,
props: {},
_owner: null,
_store: {} }
They both appear to be react.elements and https://testing-library.com/docs/react-testing-library/api implies this is what it expects.
What have I done wrong?