When rendering an AutoComplete, I get the following warning:
Warning: Failed prop type: Invalid prop `children` supplied to `Popup`.
in Popup (created by ListContainer)
in ListContainer (created by AutoComplete)
in span (created by AutoComplete)
in AutoComplete
I have tried this in the simple case below:
ReactDOM.render(<
script
src
=
"https://cdnjs.cloudflare.com/ajax/libs/prop-types/15.7.2/prop-types.min.js"
></
script
>
Hello Stefan,
I tried your example in my development environment and received no errors. On further examination I found this difference -- with your example, the react and react-dom packages are being used in the Webpack bundle, whereas my application uses react and react-dom externally.
I have the following in my webpack.config.js file:
module.exports = {
...
externals: {
"react": "React",
"react-dom": "ReactDOM"
}
...
}
and in my page I include these two modules externally, before including the bundle script:
<script type="text/javascript" src="<%= ResolveClientUrl("~/node_modules/react/umd/react.development.js") %>"></script>
<script type="text/javascript" src="<%= ResolveClientUrl("~/node_modules/react-dom/umd/react-dom.development.js") %>"></script>
<script type="text/javascript" src="<%= ResolveClientUrl("~/Scripts/dist/main.js") %>"></script>
When I do this, the invalid props warning occurs. Is there a way to use React externally like this and not get the warning?
Thank you,
Nathaniel