项目场景:

下拉框选择操作


问题描述

先看浏览器报错信息,如图:

ERROR
React.Children.only expected to receive a single React element child.
    at Object.onlyChild [as only] (http://localhost:2028/static/js/bundle.js:237997:15)
    at renderOverlay (http://localhost:2028/static/js/bundle.js:43267:34)
    at getOverlayElement (http://localhost:2028/static/js/bundle.js:160204:24)
    at getMenuElement (http://localhost:2028/static/js/bundle.js:160225:26)

react-antD 下拉框组件使用出现的问题(antd版本问题)-menus-LMLPHP


原因分析:

react-antD 下拉框组件使用出现的问题(antd版本问题)-menus-LMLPHP


解决方案:

这个是改后的写法;仅供参考(主要还是overlay的问题)
react-antD 下拉框组件使用出现的问题(antd版本问题)-menus-LMLPHP

09-20 11:20