props.parentMenu is undefined
All of the sudden my application started crashing at node_modules/antd/node_modules/rc-menu/es/SubMenu.js:260
260 | var getPopupContainer = props.parentMenu.isRootMenu ? props.parentMenu.props.getPopupContainer : function (triggerNode) {
return triggerNode.parentNode;
};
with an error: TypeError: props.parentMenu is undefined
I fixed it by coalescing the undefined:
var getPopupContainer = props.parentMenu ? props.parentMenu.isRootMenu ? props.parentMenu.props.getPopupContainer : function (triggerNode) {
return triggerNode.parentNode;
} : null;
But I don't really know if that's the best way to do this. I'm using rc-menu as a dependency of antd library.
Did you have a reproducible demo?
This component uses the menu:
https://github.com/adrianmisko/bookstore-spa/blob/master/src/components/Nav/Nav.js
If I download snapshot of that repo and run npm install & umi dev the project crashes.
Tomorrow I'll check earlier snapshot of this project and see if that works. Will also try to check it on different machine (mine is Ubuntu 18.04 LTS with node 11.3.0 and npm 6.7.0)
Could you provide a reproducible demo by http://u.ant.design/codesandbox-repro?