react使用小记1
来源:互联网 发布:王健林 鲁豫 知乎 编辑:程序博客网 时间:2024/06/06 02:17
浏览器显示的问题描述!
Warning: Failed prop type: Invalid prop `children` of type `string` supplied to `MuiThemeProvider`, expected a single ReactElement.
in MuiThemeProvider (created by Root)in Root (created by RouterContext)
in RouterContext (created by Router)
in Router
printWarning @ warning.js:36
warning @ warning.js:60
checkReactTypeSpec @ checkReactTypeSpec.js:80
validatePropTypes @ ReactElementValidator.js:151
createElement @ ReactElementValidator.js:194
render @ Root.js:72
(anonymous) @ makeAssimilatePrototype.js:15
(anonymous) @ ReactCompositeComponent.js:796
measureLifeCyclePerf @ ReactCompositeComponent.js:75
_renderValidatedComponentWithoutOwnerOrContext @ ReactCompositeComponent.js:795
_renderValidatedComponent @ ReactCompositeComponent.js:822
performInitialMount @ ReactCompositeComponent.js:362
mountComponent @ ReactCompositeComponent.js:258
mountComponent @ ReactReconciler.js:46
performInitialMount @ ReactCompositeComponent.js:371
mountComponent @ ReactCompositeComponent.js:258
mountComponent @ ReactReconciler.js:46
performInitialMount @ ReactCompositeComponent.js:371
mountComponent @ ReactCompositeComponent.js:258
mountComponent @ ReactReconciler.js:46
performInitialMount @ ReactCompositeComponent.js:371
mountComponent @ ReactCompositeComponent.js:258
mountComponent @ ReactReconciler.js:46
mountComponentIntoNode @ ReactMount.js:104
perform @ Transaction.js:140
batchedMountComponentIntoNode @ ReactMount.js:126
perform @ Transaction.js:140
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
batchedUpdates @ ReactUpdates.js:97
_renderNewRootComponent @ ReactMount.js:320
_renderSubtreeIntoContainer @ ReactMount.js:401
render @ ReactMount.js:422
(anonymous) @ app.js:30
(anonymous) @ app.js:39
(anonymous) @ app.js:40
(anonymous) @ app.js:1060
__webpack_require__ @ app.js:556
fn @ app.js:87
(anonymous) @ multi_main:5
(anonymous) @ app.js:586
__webpack_require__ @ app.js:556
(anonymous) @ app.js:579
(anonymous) @ app.js:582
invariant.js:44 Uncaught Error: MuiThemeProvider.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
at invariant (invariant.js:44)
at ReactCompositeComponentWrapper._renderValidatedComponent (ReactCompositeComponent.js:831)
at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:362)
at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:258)
at Object.mountComponent (ReactReconciler.js:46)
at ReactDOMComponent.mountChildren (ReactMultiChild.js:238)
at ReactDOMComponent._createInitialChildren (ReactDOMComponent.js:697)
at ReactDOMComponent.mountComponent (ReactDOMComponent.js:516)
at Object.mountComponent (ReactReconciler.js:46)
at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:371)
解决办法
引入
import getMuiTheme from 'material-ui/styles/getMuiTheme';import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
<MuiThemeProvider muiTheme={getMuiTheme()}> <Paper style={styles.paper} zDepth={1} /></MuiThemeProvider>
这么解决应该有缺陷,以后弥补
上边是修改前的问题代码截图;
解决完了Paper就出来了
0 0
- react使用小记1
- react 小记
- react 小记
- React Native react-native-vector-icons 使用小记
- 小记react-native 安装
- React-native小记
- react-native小记
- React学习小记
- React-Redux学习小记
- maven 使用小记1
- LyX使用小记(1)
- NS2使用小记----1
- Android React Native植入原生应用小记
- React native 环境安装配置小记
- 使用jprofiler监控线程学习小记1
- Spring Boot的使用小记(1)
- React使用
- react使用
- Android设备的蓝牙通信
- User-Agent详解
- Unity 配置窍门:内存,音频和纹理
- 24种设计模式与7大原则
- [leetcode]345. Reverse Vowels of a String
- react使用小记1
- iOS利用Xcode制作静态库和动态库
- Mysql 执行外部脚本
- Java经典算法——窃贼问题
- 两个host上的qemu VM使用bridge互通
- 文章标题
- gdb调试-dump
- ps动作储存覆盖原文件的原因
- python实现感知机(perceptron)原型~