没有合适的资源?快使用搜索试试~ 我知道了~
首页React Quickly--2017
React Quickly is for anyone who wants to learn React.js fast. This hands-on book teaches you the concepts you need with lots of examples, tutorials, and a large main project that gets built throughout the book
资源详情
资源评论
资源推荐
REACT CHEATSHEET
INSTALLATION SPECIAL PROPERTIES
React
<script src="https://unpkg.com/react@15/dist/react.js"></script>
$ $ npm install react --save
$ $ bower install react --save
React DOM
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
$ npm install react-dom
$ bower install react-dom --save
key
—Unique identifier for an element to turn arrays/lists into hashes for better performance. For
example:
key={id}.
ref—Reference to an element via this.refs.NAME. For example: ref="email" will create a
this.refs.email DOM node or ReactDOM.findDOMNode(this.refs.email).
style—Accepts an object for camelCased CSS styles instead of a string (immutable since v0.14).
For example: style={{color: red}}.
className—HTML class attribute. For example: className="btn".
htmlFor—HTML for attribute. For example: htmlFor="email".
dangerouslySetInnerHTML—Sets inner HTML to raw HTML by providing an object with the key
__html.
children—Sets the content of the element via this.props.children. For example:
this.props.children[0].
data-NAME—Custom attribute. For example: data-tooltip-text="...".
RENDERING
ES5
ReactDOM.render(
React.createElement(
Link,
{href: 'https://Node.University'}
)
),
document.getElementById('menu')
)
ES5+JSX
ReactDOM.render(
<Link href='https://Node.University'/>,
document.getElementById('menu')
)
Server-side rendering
const ReactDOMServer = require('react-dom/server')
ReactDOMServer.renderToString(Link, {href: 'https://Node.University'})
ReactDOMServer.renderToStaticMarkup(Link, {href:
➥
'https://Node.University'})
LlFECYCLE EVENTS
componentWillMount function()
componentDidMount function()
componentWillReceiveProps function(nextProps)
shouldComponentUpdate function(nextProps, nextState) -> bool
componentWillUpdate function(nextProps, nextState)
componentDidUpdate function(prevProps, prevState)
componentWillUnmount function()
COMPONENT PROPERTIES AND METHODS
Properties
this.refs—Lists components with a ref property.
this.props—Lists any properties passed to an element (immutable).
this.state—Lists states set by setState and getInitialState (mutable). Avoid setting
state manually with
this.state=...
this.isMounted
—Flags whether the element has a corresponding DOM node.
Methods
setState(changes)—Changes state (partially) to this.state, and triggers a rerender
replaceState(newState)—Replaces this.state, and triggers a rerender
forceUpdate()—Triggers an immediate DOM rerender
propTypes
Types available under React.PropTypes:
any array bool element func
node number object string
To make a property required (warning only), append .isRequired.
More methods
instanceOf(constructor)
oneOf (['News', 'Photos'])
oneOfType([propType, propType])
Custom validation
propTypes: {
customProp: function(props, propName, componentName) {
if (!/regExPattern/.test(props[propName])) {
return new Error('Validation failed!');
}
}
}
REACT ADDONS
As npm modules:
react-addons-css-transition-group
react-addons-perf
react-addons-test-utils
react-addons-pure-render-mixin
react-addons-linked-state-mixin
react-addons-clone-with-props
react-addons-create-fragment
react-addons-css-transition-group
react-addons-linked-state-mixin
react-addons-pure-render-mixin
react-addons-shallow-compare
react-addons-transition-group
react-addons-update
www.allitebooks.com
Praise for React Quickly
“React Quickly is a one-stop shop for anyone who wants a guided introduction to
React and the ecosystem of tools, concepts, and libraries around it. Follow Azat’s
walkthroughs, work on the projects given, and you’ll soon understand React, Redux,
GraphQL, Webpack, and Jest, as well as how to put them to work.”
—Peter Cooper, editor of JavaScript Weekly
“React Quickly teaches the reader the most valuable and buzz-worthy concepts in
building modern web applications with React including GraphQL, Webpack, and
server-side rendering. After reading React Quickly, you should feel confident in
your ability to create a production-grade web application with React.”
—Stan Bershadskiy, author of React Native Cookbook
“Azat is one of the most authoritative voices in the programming space. This book
goes far beyond the basics by deep diving into React’s foundation and architecture.
It’s a must read for any developer!”
—Erik Hanchett, author of Ember.js Cookbook
“This book is simple to follow. It uses very basic language that makes you
understand each concept step by step.”
—Israel Morales, front-end developer and
web designer at SavvyCard
“Simple language with simple logical examples to get you up and running quickly is
why this book truly justifies its title, React Quickly. This book covers all the major
topics that any developer new to React needs in order to start writing apps using
React. And the author’s sense of humor will keep you engaged until the end. I am
thankful Azat took time to share his React journey with us.”
—Suhas Deshpande, software engineer at Capital One
“React Quickly is a great resource for coming up to speed with React. Very thorough
and relevant. I’ll be using it as a reference for my next app.”
—Nathan Bailey, full stack developer at SpringboardAuto.com
www.allitebooks.com
“Azat is great at what he does—teaching people how to code. React Quickly
contains fundamental knowledge as well as practical examples to get you started
using React quickly.”
—Shu Liu,
IT consultant
“Since being open sourced by Facebook in 2013, React.js has rapidly become a widely
adopted JS library and one of the most starred projects on GitHub. In his new book,
React Quickly, Azat Mardan has, in his typical lucid style, laid out everything you
need to learn about the React ecosystem in order to build performant SPA
applications quickly. Just the chapters on React state and Universal JavaScript are
worth the price of the book.”
—Prakash Sarma, New Star Online
“React Quickly will ease your adoption of React by giving you a clear foundation,
and it will have you building applications that thoroughly embrace the benefits of
using React.
—Allan Von Schenkel,
VP of Technology & Strategy at FoundHuman
“React Quickly covers all the important aspects of React in an easy-to-consume
fashion. This book is like all of Azat’s work: clear and concise, and it covers what’s
needed to become productive quickly. If you are interested in adding React to your
skill set, I say start here.”
—Bruno Watt, consulting architect at hypermedia.tech
“React Quickly is an incredibly comprehensive book on full-stack web development
with React.js, covering not just React itself but the ecosystem surrounding it. I’ve
always been mystified by server-side React and found that Azat’s book really helped
me finally understand it. If you’re new to React and would like to truly master it, I
would look no further than this book.”
—Richard Kho, software engineer at Capital One
www.allitebooks.com
剩余531页未读,继续阅读
白鸽-小蛋
- 粉丝: 10
- 资源: 167
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0