标签 react 下的文章

React-native: Super expression must either be null or a function, not undefined


React-native: Super expression must either be null or a function, not undefined

Change your import statement like below and try.

<wiz_code_mirror>
</wiz_code_mirror>


https://stackoverflow.com/questions/37676522/react-native-super-expression-must-either-be-null-or-a-function-not-undefined


Navigator


Navigator
Navigator即导航器,通过导航器我们可以实现应用在不同的页面之间进行跳转。 
React Native的编程思想类似于iOS, 导航栏也使用Navigator作为标识, 类似于AndroidActionBar. 导航栏作为最重要的应用组件之一, 除了处理页面导航功能以外, 还会提供


接收一个事件处理器作为props


接收一个事件处理器作为props


Talker.js
<wiz_code_mirror>

React.createClass


React.createClass

you know that React.createClass's job is to create a component class, which is like a factory for building React components.You also know that React.createClass is one of the methods on the object returned by require('react'), on line 1(var React = require('react');)。

Component class variable names must begin with capital letters!

React.createClass takes one argument. That argument must be a JavaScript object. This object will act as a set of instructions, explaining to your component class how to build a React component.


There is only one property that you have to include in this object: a render function.
A render function is a property whose name is render, and whose value is a function. The term "render function" can refer to the entire property, or to just the function part.
var instructions = { render: function () {} };

A render function must have a return statement. Usually, this return statement returns a JSX expression:

var instructions = { render: function () { return <h1>Hello world</h1>; } };

创建一个component实例:
var React = require('react');
var ReactDOM = require('react-dom');

var MyComponentClass = React.createClass({
  render: function () {
    return <h1>Hello world</h1>;
  }
});
ReactDOM.render(
<MyComponentClass />, 
document.getElementById('app')
);



使用对象时注意的地方
<wiz_code_mirror>
</wiz_code_mirror>

嵌入js代码时,对象的属性在JSX中要用大括号括起来
注意:在变量赋值时不需要加{},如
 




shijiebei 365bet manbetx 188bet xinshui caipiao 95zz tongbaoyule beplay 88bifa 18luck betway bwin hg0088 aomenjinshayulecheng ca88 shenbotaiyangcheng vwin w88 weide