项目场景:
下拉框选择操作
问题描述
先看浏览器报错信息,如图:
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)
原因分析:
解决方案:
这个是改后的写法;仅供参考(主要还是overlay的问题)