react's People
react's Issues
React.Component
1.componentWillMount在render之前,所以不会触发rerender
2. 一般推荐在constructor中初始化state,而不是 componentWillMount
homepage
homepage
-
特点:基于组件,编写封闭组件管理自身状态,多个组件合成复杂UI
-
特点:一次学习,各处使用-serve用 Node、mobile用 React Native
-
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)
备注:更高版本可能不用此返回组件引用(由于有时异步渲染组件)
- A Stateful Component
state变化时,重新调用render来重渲染
dangerouslySetInnerHTML 用来直接为元素插入子HTML
INSTALLATION
- 由于React的 gradual adoption特性,可以跟随需求极少量或大量使用
Getting Started
1,如果只是需要向已有网页引入部分交互的话,直接引入React的JS包即可
2,随着项目的扩大,需要考虑更加集成化的设置
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.