没有合适的资源?快使用搜索试试~ 我知道了~
首页React Quickly Painless web apps with React, JSX, Redux, and GraphQL 无水印原版pdf
React Quickly Painless web apps with React, JSX, Redux, and GraphQL 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
资源详情
资源评论
资源推荐


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

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

“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

React Quickly
PAINLESS WEB APPS WITH REACT, JSX, REDUX, AND GRAPHQL
AZAT MARDAN
FOREWORD BY JOHN SONMEZ
MANNING
SHELTER ISLAND
剩余531页未读,继续阅读



















安全验证
文档复制为VIP权益,开通VIP直接复制

评论1