js框架 - React
羽下佳人
爱好敲代码,敲代码
展开
-
react bug
1.Uncaught Invariant Violation:_registerComponent(...): Target container is not a DOM element. 这里的 id 名字写错了。 2.组件 不报错 无反应问题: 新建变量 首字母 小写。 只有首字母 大写 才正确解读。<div id="example">...原创 2017-04-11 10:51:34 · 661 阅读 · 0 评论 -
react 入门
入门资料: 阮一峰: http://www.ruanyifeng.com/blog/2015/03/react.html 很好的入门资料react - demo : https://github.com/ruanyf/react-demos 深入研究:学习网址: https://facebook.github.io/react/index.html官网示...原创 2017-04-11 10:41:50 · 421 阅读 · 0 评论 -
react 小例子
1.初步环境<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title></title> <script src="../js/react.js"&am原创 2017-04-11 10:44:02 · 282 阅读 · 0 评论 -
react 组件
1.注意: 组件 变量名 首字母 必须大写 <div id="example"></div><script type="text/babel"> var A = React.createClass({ render: function(){ return <h1>hello ! {this....原创 2017-04-11 10:45:52 · 198 阅读 · 0 评论 -
react this.props.children
div 中插入 数组 ,this.props.children ,创建变量<body> <div id="example"></div> <script type="text/babel"> var List = React.createClass({ render : function()...原创 2017-04-11 10:47:16 · 455 阅读 · 0 评论 -
react this.state + 组件生命周期
组件的生命周期分成三个状态: Mounting:已插入真实 DOM Updating:正在被重新渲染 Unmounting:已移出真实 DOMReact 为每个状态都提供了两种处理函数,will 函数在进入状态之前调用,did 函数在进入状态之后调用,三种状态共计五种处理函数。 componentWillMount() componentDidMount() compon...原创 2017-04-11 10:49:26 · 307 阅读 · 0 评论 -
react handleClick
<div id="example"></div><script type="text/babel"> var Text = React.createClass({ handleClick: function(){ this.refs.iptfocus.focus(); }, rend...原创 2017-04-11 10:48:43 · 2220 阅读 · 0 评论 -
react PropTypes
<script type="text/babel"> var data = 123; var Prop = React.createClass({ propTypes : { title : React.PropTypes.string.isRequired, }, render: funct...原创 2017-04-11 10:47:49 · 273 阅读 · 0 评论