随笔分类 -  React

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页
摘要:Sometimes you have common use cases that require common props to be applied to certain elements. You can collect these props into an object for users 阅读全文
posted @ 2017-12-14 01:30 Zhentiw 阅读(155) 评论(0) 推荐(0)
摘要:Compound component gives more rendering control to the user. The functionality of the component stays intact while how it looks and the order of the c 阅读全文
posted @ 2017-12-13 03:02 Zhentiw 阅读(259) 评论(0) 推荐(0)
摘要:Parcel comes in as the new cool kid in the bundlers world. Unlike other bundlers which take lots of explicit configuration, Parcel works out of the bo 阅读全文
posted @ 2017-12-11 16:06 Zhentiw 阅读(238) 评论(0) 推荐(0)
摘要:In this lesson we'll talk about controlling the value for inputs, textareas, and select elements. We'll see how to manage the state ourselves while st 阅读全文
posted @ 2017-12-08 20:54 Zhentiw 阅读(200) 评论(0) 推荐(0)
摘要:In this lesson we'll take a stopwatch component we built in another lesson and identify and fix a memory leak. Tow things to notice here is that: 1. t 阅读全文
posted @ 2017-12-07 20:33 Zhentiw 阅读(712) 评论(0) 推荐(0)
摘要:In this lesson we'll learn about how you can use the prop-types module to validate a custom React component's props. You can write you own PropTypes v 阅读全文
posted @ 2017-12-07 20:09 Zhentiw 阅读(236) 评论(0) 推荐(0)
摘要:In Single Page Apps we're used to fetch the data on event callbacks. That disables the capacity to use the URL to share it to someone else and get to 阅读全文
posted @ 2017-11-06 18:01 Zhentiw 阅读(317) 评论(0) 推荐(0)
摘要:In certain situations, you care more about the final state of the redux store than you do about the particular stream of events coming out of an epic. 阅读全文
posted @ 2017-10-17 19:34 Zhentiw 阅读(624) 评论(0) 推荐(0)
摘要:Often in unit tests we are focussing on the logic involved in crafting a network request, & how we respond to the result. The external service is unli 阅读全文
posted @ 2017-10-17 18:57 Zhentiw 阅读(1185) 评论(0) 推荐(0)
摘要:Epics can be unit-tested just like any other function in your application - they have a very specific set of inputs (the action$ stream) and the outpu 阅读全文
posted @ 2017-10-17 18:20 Zhentiw 阅读(215) 评论(0) 推荐(0)
摘要:With redux-observable, we have the power of RxJS at our disposal - this means tasks that would otherwise be complicated and imperative, become simple 阅读全文
posted @ 2017-10-16 00:30 Zhentiw 阅读(798) 评论(0) 推荐(0)
摘要:Imaging you are building a Tabs component. If looks like: You want to know which tab is clicked (actived). But you don't want this actived tab state b 阅读全文
posted @ 2017-10-13 19:06 Zhentiw 阅读(561) 评论(0) 推荐(0)
摘要:More detail check LInk. Render Prop vs HOC: HOC version for withMouse: Problems: Indirection. We still have the same problem with indirection that we 阅读全文
posted @ 2017-10-10 00:27 Zhentiw 阅读(296) 评论(0) 推荐(0)
摘要:class Toggle extends Component { static propTypes = { defaultOn: PropTypes.bool, on: PropTypes.bool, onToggle: PropTypes.func, children: PropTypes.oneOfType([ PropTypes.func, ... 阅读全文
posted @ 2017-10-05 19:46 Zhentiw 阅读(299) 评论(0) 推荐(0)
摘要:Sometimes it’s desired to decide within an updater function if an update to re-render should be triggered. Calling .setState with null no longer trigg 阅读全文
posted @ 2017-09-28 22:26 Zhentiw 阅读(156) 评论(0) 推荐(0)
摘要:By default the React Component Tree directly maps to the DOM Tree. In some cases when you have UI elements like overlays or loading bars this can be l 阅读全文
posted @ 2017-09-28 20:59 Zhentiw 阅读(230) 评论(0) 推荐(0)
摘要:In this session we create a comment component to explore how to create components that only render text. In previous versions of we had to wrap our te 阅读全文
posted @ 2017-09-28 04:06 Zhentiw 阅读(175) 评论(0) 推荐(0)
摘要:Here we want to test a toggle button component, when the button was click, state should change, style should change also. Toggle component: Test: 阅读全文
posted @ 2017-09-20 02:52 Zhentiw 阅读(683) 评论(0) 推荐(0)
摘要:For example we have a React comonent: -- A toggle button, we want to test. When it si toggle on, the color is a little bit darken than it's not. Testi 阅读全文
posted @ 2017-09-20 01:59 Zhentiw 阅读(426) 评论(0) 推荐(0)
摘要:This lesson explains how actions can be used to control and modify the state of your application. They help you to structure your code base and integr 阅读全文
posted @ 2017-09-09 21:01 Zhentiw 阅读(376) 评论(0) 推荐(0)

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页