Giter VIP home page Giter VIP logo

react's People

Watchers

 avatar

react's Issues

React.Component

React.Component

1.componentWillMount在render之前,所以不会触发rerender
2. 一般推荐在constructor中初始化state,而不是 componentWillMount

homepage

homepage

  1. 特点:基于组件,编写封闭组件管理自身状态,多个组件合成复杂UI

  2. 特点:一次学习,各处使用-serve用 Node、mobile用 React Native

  3. A SimPle Component

React组件extends自React.Component
JSX语法是可选的:
      JSX:return <div>xx</div>
      原生:return React.createElement(type,[props],[...children])
ReactDOM.render(element,container[,callback])  //参数为:元素、父节点、可选的回调
      作用:在container中调用,渲染react元素element到提供的container节点中,并返回组件引用(对于stainless组件返回的是null)
      备注:更高版本可能不用此返回组件引用(由于有时异步渲染组件)
  1. A Stateful Component
state变化时,重新调用render来重渲染
dangerouslySetInnerHTML 用来直接为元素插入子HTML

INSTALLATION

  1. 由于React的 gradual adoption特性,可以跟随需求极少量或大量使用

Getting Started

1,如果只是需要向已有网页引入部分交互的话,直接引入React的JS包即可

2,随着项目的扩大,需要考虑更加集成化的设置

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.