Reactjs React MaterialUI:createSvgIcon不是一个函数
我正在尝试使用MaterialUI的自动完成组件进行React。在编辑器中,一切看起来都很好,编译也很好。但是,我得到以下运行时错误:Reactjs React MaterialUI:createSvgIcon不是一个函数,reactjs,material-ui,Reactjs,Material Ui,我正在尝试使用MaterialUI的自动完成组件进行React。在编辑器中,一切看起来都很好,编译也很好。但是,我得到以下运行时错误: app.js:42207 Uncaught TypeError: (0 , _utils.createSvgIcon) is not a function at Object.393.@babel/runtime/helpers/interopRequireWildcard (app.js:42207) at o (app.js:6) a
app.js:42207 Uncaught TypeError: (0 , _utils.createSvgIcon) is not a function
at Object.393.@babel/runtime/helpers/interopRequireWildcard (app.js:42207)
at o (app.js:6)
at app.js:6
at Object.<anonymous> (app.js:41216)
at Object.390.../internal/svg-icons/ArrowDropDown (app.js:42145)
at o (app.js:6)
at app.js:6
at Object.391../Autocomplete (app.js:42167)
at o (app.js:6)
at app.js:6
您可能安装了错误版本的
@material ui/icons
尝试删除package lock.json
和node\u modules
文件夹,然后再次运行npm install
import TextField from '@material-ui/core/TextField';
import Autocomplete from '@material-ui/lab/Autocomplete';
...
<Autocomplete
id="edit-var"
freeSolo
options={props.existing}
renderInput={params => (
<TextField
{...params}
label="Variable"
margin="normal"
variant="outlined"
value={props.variable.name}
autoFocus={true}
onChange={e => props.onUpdate({ ...props.variable, name: e.currentTarget.value })}
/>
)}
/>
"@material-ui/core": "^4.8.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",