JHJ
JHJ
新手
新手
  • 最后登录2018-03-29
  • 发帖数2
阅读:6881回复:0

[react]react 数据传递不能渲染到页面

楼主#
更多 发布于:2018-01-02 15:30
react的一个坑,不知道你跳进去没有
在引入组件的时候变量名开头大写。
之前这样写import commentBox from ‘./comment/commentBox.js’
jsx代码  
<commentBox author="xxx">hello </commentBox>
这样写的话app.js属性不能传递出去,页面渲染不出来。


后来改成import CommentBox from ‘./comment/commentBox.js’

jsx代码  
<CommentBox author="xxx">hello </CommentBox>
页面渲染就OK啦!
游客


返回顶部

公众号

公众号