随笔分类 -  React

摘要:When using Redux, we can test that our application state changes are working by testing that dispatching actions to the store creates our expected out... 阅读全文
posted @ 2016-01-11 17:06 Zhentiw
摘要:When testing React components, we often want to make sure the rendered output of the component matches what we expect. With the React Shallow Renderer... 阅读全文
posted @ 2016-01-07 16:53 Zhentiw
摘要:Setting up a shallow renderer for each test can be redundant, especially when trying to write similar tests that have slight tweaks. In this lesson, w... 阅读全文
posted @ 2016-01-07 15:12 Zhentiw
摘要:Often our components have output that shows differently depending on the props it is given; in this lesson, we go over how to compare theclassNameprop... 阅读全文
posted @ 2016-01-07 03:52 Zhentiw
摘要:The React Shallow Renderer test utility lets us inspect the output of a component one level deep. In this lesson, we will examine the rendered output ... 阅读全文
posted @ 2016-01-07 03:37 Zhentiw
摘要:When you render a component with the Shallow Renderer, you have access to the underlying object. We can write lots of useful tests to check that our c... 阅读全文
posted @ 2016-01-05 02:26 Zhentiw
摘要:When writing React component tests, it can be hard to decipher the error diffs of broken tests, since they are just the final objects that React uses ... 阅读全文
posted @ 2016-01-05 01:54 Zhentiw
摘要:In this lesson, we walk through how to use one of React's Test Utilities (from thereact-addons-test-utilspackage) called "Shallow Rendering". This let... 阅读全文
posted @ 2016-01-05 01:23 Zhentiw
摘要:To write tests for our React code, we need to first install some libraries for running tests and writing assertions. In this lesson we walk through se... 阅读全文
posted @ 2016-01-04 03:59 Zhentiw
摘要:we leverage private components to break our render function into more manageable pieces without leaking the implementation details of our component. ... 阅读全文
posted @ 2015-12-31 04:05 Zhentiw
摘要:Before you use the React Redux bindings, learn how to create a complete simple application with just React and Redux. JS Bin const counter = ... 阅读全文
posted @ 2015-11-26 03:38 Zhentiw
摘要:React lets you use "inline styles" to style your components; inline styles in React are just JavaScript objects that you can render in an element'ssty... 阅读全文
posted @ 2015-09-10 17:52 Zhentiw
摘要:You can easily spend hours configuring the perfect dev environment with all the latest hotness like ES6 (and beyond) support, hot reloading, and a myr... 阅读全文
posted @ 2015-09-06 03:13 Zhentiw
摘要:Since React is only interested in the V (view) of MVC, it plays well with other toolkits and frameworks. This includesAngularJSandD3.A app with React ... 阅读全文
posted @ 2015-09-03 03:52 Zhentiw
摘要:It can be tedious to type out all the boilerplate needed to get the DOM and states inReactto synchronize. Luckily, React provides a version of the too... 阅读全文
posted @ 2015-09-02 19:49 Zhentiw
摘要:ESLint is a JavaScript linter (static analysis tool) that offers full support for ES6, JSX, and other modern tools via plugins. We walk through settin... 阅读全文
posted @ 2015-08-31 15:13 Zhentiw
摘要:The JSX Transformer library isnotrecommended for production use. Instead, you'll probably want to precompile your JSX into JavaScript.Install:npm inst... 阅读全文
posted @ 2015-08-27 20:06 Zhentiw
摘要:"JSX transforms from an XML-like syntax into native JavaScript. XML elements and attributes are transformed into function calls and objects, respectiv... 阅读全文
posted @ 2015-08-26 19:25 Zhentiw
摘要:we want to have the ability to write JSX and see the output live in the browser. Compiler 阅读全文
posted @ 2015-08-26 19:13 Zhentiw
摘要:React components can be dynamically generated based on a dataset. This lesson will show you how to do just that. React Lesson 15: dynamically c... 阅读全文
posted @ 2015-08-18 01:04 Zhentiw