TypeError: Cannot read property 'ownerDocument' of null
See original GitHub issueEnvironment(required)
- antd version: 2.8.0
- OS and its version: Ubuntu 16.04
- Browser and its version: Google Chrome Versión 57.0.2987.98 (64-bit)
What did you do? Please provide steps to re-produce your problem.
I’m using some components in a project and they fail when I create the snapshots with Jest.
What do you expected?
Works fine.
What happen?
It lauchs this error:
TypeError: Cannot read property 'ownerDocument' of null
at offset (node_modules/rc-tabs/lib/InkTabBarMixin.js:44:17)
at _componentDidUpdate (node_modules/rc-tabs/lib/InkTabBarMixin.js:63:25)
at componentDidMount (node_modules/rc-tabs/lib/InkTabBarMixin.js:116:5)
at chainedFunction [as componentDidMount] (node_modules/react/lib/ReactClass.js:521:9)
at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:265:25
at measureLifeCyclePerf (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:75:12)
at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:264:11
at CallbackQueue.notifyAll (node_modules/react-test-renderer/lib/CallbackQueue.js:76:22)
at ReactTestReconcileTransaction.close (node_modules/react-test-renderer/lib/ReactTestReconcileTransaction.js:36:26)
at ReactTestReconcileTransaction.closeAll (node_modules/react-test-renderer/lib/Transaction.js:206:25)
at ReactTestReconcileTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:153:16)
at batchedMountComponentIntoNode (node_modules/react-test-renderer/lib/ReactTestMount.js:69:27)
at ReactDefaultBatchingStrategyTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:140:20)
at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactDefaultBatchingStrategy.js:62:26)
at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactUpdates.js:97:27)
at Object.render (node_modules/react-test-renderer/lib/ReactTestMount.js:125:18)
But, if i mock ‘antd’ the problem dissapear:
jest.mock('antd');
In fact, it works only mocking the rc-tabs component:
jest.mock('rc-tabs');
The problem is that when I mock the antd/rc-tabs the snapshot is almost empty. For instance:
exports[`test RSFilters Snapshot matchs 1`] = `
<div
style={
Object {
"height": "100%",
}
} />
`;
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property 'ownerDocument ...
I think my view is returning proper JSON but now data is not being added to the .mainContent div. It gives this error:...
Read more >Can not read property ownerDocument of null #542 - GitHub
I am getting TypeError: Cannot read property 'ownerDocument' of null even if all the required props are passed to Container and element.
Read more >Cannot read property 'ownerDocument' of undefined - Laracasts
I put a child component called <page-buttons> in my main Vue component. This component has some buttons floating on the page.
Read more >cannot read properties of null (reading 'ownerdocument')
I am getting TypeError: Cannot read property 'ownerDocument' of null even if all the required props are passed to Container and element. Line...
Read more >Cannot read property ownerDocument of null - Mendix Forum
The page doesn't receive an object. Perhaps because of access rights or because there is no object passed to the page.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So you shouldn’t mock rc-tabs.
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.