随笔分类 -  React

摘要:State is used for properties on a component that will change, versus static properties that are passed in. This lesson will introduce you to taking in 阅读全文
posted @ 2016-08-15 03:29 Zhentiw 阅读(159) 评论(0) 推荐(0)
摘要:This lesson will teach you the basics of setting properties in your React components. 阅读全文
posted @ 2016-08-14 05:41 Zhentiw 阅读(121) 评论(0) 推荐(0)
摘要:Higher order components will allow you to apply behaviors to multiple React components. So the idea is to create a high order component, then use this 阅读全文
posted @ 2016-08-07 15:24 Zhentiw 阅读(200) 评论(0) 推荐(0)
摘要:The React team has an official Command Line Interface (CLI) for building React projects called "Create React App"; in this lesson, we show how to use 阅读全文
posted @ 2016-08-02 01:13 Zhentiw 阅读(183) 评论(0) 推荐(0)
摘要:Classnames is a simple yet versatile javascript utility that joins CSS class names based on a set of conditions. We are going to build a simple toggle 阅读全文
posted @ 2016-07-05 03:48 Zhentiw 阅读(279) 评论(0) 推荐(0)
摘要:Most of the components that you write will be stateless, meaning that they take in props and return what you want to be displayed. In React 0.14, a si 阅读全文
posted @ 2016-07-05 03:29 Zhentiw 阅读(659) 评论(0) 推荐(0)
摘要:Applications are driven by state. Many things, like the user interface, should always be consistent with that state.MobX is a general purpose FRP libr 阅读全文
posted @ 2016-06-01 05:03 Zhentiw 阅读(337) 评论(0) 推荐(0)
摘要:Install: Init: Script: Check the src folder. Add mark to the file which you want to check: function to be checked: When the flow runs, it will report 阅读全文
posted @ 2016-05-07 16:13 Zhentiw 阅读(190) 评论(0) 推荐(0)
摘要:In a CSS library like Bootstrap we can set a button's style to be "primary" or "secondary" by appending classes. For React components we want to be ab 阅读全文
posted @ 2016-04-18 01:25 Zhentiw 阅读(418) 评论(0) 推荐(0)
摘要:setRouteWillLeaveHook provides a method for us to intercept a route change before leaving the current route. setRouteWillLeaveHook provides a method f 阅读全文
posted @ 2016-03-31 14:41 Zhentiw 阅读(1652) 评论(0) 推荐(0)
摘要:The Redirect component in react-router does exactly what it sounds like. It allows us to redirect from from one route to another. The Redirect compone 阅读全文
posted @ 2016-03-30 13:46 Zhentiw 阅读(2730) 评论(0) 推荐(0)
摘要:Define query param in Link, accept path and query : Use Query param by props.location.query: 阅读全文
posted @ 2016-03-30 13:38 Zhentiw 阅读(1089) 评论(0) 推荐(0)
摘要:In this lesson we'll learn how to render multiple component children from a single route. Define a named component by "components": 'header' and 'body 阅读全文
posted @ 2016-03-29 13:23 Zhentiw 阅读(220) 评论(0) 推荐(0)
摘要:A router library is no good if we have to hardcode every single route in our application. In this lesson we look at how to access variables in our rou 阅读全文
posted @ 2016-03-29 12:58 Zhentiw 阅读(879) 评论(0) 推荐(0)
摘要:IndexRoute allows us to define a default child component to be rendered at a specific route when no other sub-route is available. When Home page displ 阅读全文
posted @ 2016-03-28 23:27 Zhentiw 阅读(915) 评论(0) 推荐(0)
摘要:Since react-router routes are components, creating nested routes is as simple as making one route a child of another in JSX. Make the nested component 阅读全文
posted @ 2016-03-28 23:19 Zhentiw 阅读(593) 评论(0) 推荐(0)
摘要:In this lesson we'll look at hashHistory which uses a hash hack to track our route changes vs browserHistory which delivers clean urls, but requires s 阅读全文
posted @ 2016-03-28 04:41 Zhentiw 阅读(770) 评论(0) 推荐(0)
摘要:react-router provides two props for setting a specific style on a Link component whose path matches our current route. activeStyle allows for an inlin 阅读全文
posted @ 2016-03-28 04:34 Zhentiw 阅读(2563) 评论(0) 推荐(0)
摘要:In this lesson we'll take our first look at the most common components available to us in react-router; Router, Route, and Link. 阅读全文
posted @ 2016-03-28 01:29 Zhentiw 阅读(583) 评论(0) 推荐(0)
摘要:React doesn't provide the listener to listen the DOM event. But we can do it in React life cycle: So when the compoment did mount, we add listeners to 阅读全文
posted @ 2016-03-04 03:38 Zhentiw