随笔分类 - React
摘要:In this lesson we'll show how to setup the Prompt component from React Router. We'll prompt with a static message, as well as a dynamic method with th
阅读全文
摘要:In this lesson, we look at where we came from with refs in React. Starting with the deprecated string ref pattern, callback refs, and then how to use
阅读全文
摘要:In this lesson we look at how the Apollo @client directive can be used to fetch client-side state along with server data with one query. I also show h
阅读全文
摘要:In this lesson we'll walk through setting up an updater function that can receive an action argument. We'll also dive into how to separate your state
阅读全文
摘要:In this lesson I refactor a React component that utilizes the graphql higher-order component to the new Query render prop component baked into react-a
阅读全文
摘要:In this lesson we'll explore using setState to synchronously update in componentDidMount. This allows for us to use getBoundingClientRect or other syn
阅读全文
摘要:In this lesson, I use Enzyme and Jest's Snapshot functionality to write an integration test for a component called CounterConsumer that consumes the R
阅读全文
摘要:In this lesson, I use Enzyme and Jest to unit test a Counter Render Prop component. Writing integration tests are perfect for components that consume
阅读全文
摘要:React's abstraction over the DOM means that it's not always obvious how to do DOM-related things, like working with the HTML Canvas API. When working
阅读全文
摘要:The React documentation has been warning us for a long time now that context shouldn't be used and that the API is unstable. Well, with the release of
阅读全文
摘要:Motion is an important aspect of a complete immersive experience, therefor we are going to look into the animation API Animated. Animated allows us to
阅读全文
摘要:React VR isn't limited to simple 3D primitives. By using the <Model/> Component we can place a complex 3D models into our scene.
阅读全文
摘要:In order to illuminate a scene containing 3D objects a lighting setup is required. In this lesson we'll walk through the available lighting components
阅读全文
摘要:React VR ships with a handful of 3D primitives. We'll importprimitives like <Sphere/>, <Box/>, <Cylinder/>, and <Plane/> and explore how they can posi
阅读全文
摘要:React.PureComponent is similar to React.Component. The difference between them is that React.Component doesn’t implement shouldComponentUpdate(), but
阅读全文
摘要:In this lesson we'll look at React PowerPlug's <List /> component by refactoring a normal class component with state and handlers to a functional comp
阅读全文
摘要:In this lesson, we will look at Fragments and how they are useful in achieving a cleaner DOM structure without additional empty div elements.
阅读全文
摘要:Let's stop hardcoding our initial state and fetch it from the server instead. In this lesson you will learn: Set up basic data fetching Leverage the a
阅读全文
摘要:In real life scenarios, many operations on our data are asynchronous. For example, because additional recourses need to get fetched. MST has first cla
阅读全文
摘要:n this lesson, we will set up Hot Module Reloading(HMR), making it possible to load new definitions for React components and MST models and apply them
阅读全文