ReactJS自习第叁夜

2017-05-31  本文已影响4人  行走的程序猿
jsx
const myProps = {
  a: 1,
  b: 2,
}
<myComponent {...myProps} />
render() {
  const isLoggedIn = this.state.isLoggedIn;
  return (
    <div>
      {isLoggedIn ? (
        <LogoutButton onClick={this.handleLogoutClick} />
      ) : (
        <LoginButton onClick={this.handleLoginClick} />
      )}
    </div>
  );
}
renderFullName () {
  return `${this.props.firstName} ${this.props.lastName}`;
}
ES6 箭头函数

非方法函数
纯函数

redux到底是啥
react router

每一个路由(Route)中声明的组件(比如 SignIn)在渲染之前都会被传入一些 props,具体是在源码中的 RoutingContext.js 中完成,主要包括:

webstorm 2017.1.3 激活服务器

http://idea.imsxm.com/

上一篇下一篇

猜你喜欢

热点阅读