22 Matching Annotations
- Aug 2021
-
alexsidorenko.com alexsidorenko.com
-
All consumers that are descendants of a Provider will re-render whenever the Provider’s value prop changes
Tags
Annotators
URL
-
-
blog.isquaredsoftware.com blog.isquaredsoftware.com
-
It's time to put some of these pieces together. We know that: Calling setState() queues a render of that component React recursively renders nested components by default Context providers are given a value by the component that renders them That value normally comes from that parent component's state This means that by default, any state update to a parent component that renders a context provider will cause all of its descendants to re-render anyway, regardless of whether they read the context value or not!.
-
Immutability and Rerendering 🔗︎
This section is gold to use as a teaching example
-
All of these approaches use a comparison technique called "shallow equality". This means checking every individual field in two different objects, and seeing if any of the contents of the objects are a different value. In other words, obj1.a === obj2.a && obj1.b === obj2.b && ......... This is typically a fast process, because === comparisons are very simple for the JS engine to do. So, these three approaches do the equivalent of const shouldRender = !shallowEqual(newProps, prevProps).
-
When trying to improve software performance in general, there are two basic approaches: 1) do the same work faster, and 2) do less work. Optimizing React rendering is primarily about doing less work by skipping rendering components when appropriate.
-
After it has collected the render output from the entire component tree, React will diff the new tree of objects (frequently referred to as the "virtual DOM"), and collects a list of all the changes that need to be applied to make the real DOM look like the current desired output. The diffing and calculation process is known as "reconciliation".
-
- Sep 2020
-
final-form.org final-form.org
-
useField() returns FieldRenderProps. It will manage the rerendering of any component you use it in, i.e. the component will only rerender if the field state subscribed to via useField() changes.
-
-
stackoverflow.com stackoverflow.com
-
I don't think componentDidRender is a substitute for componentDidMount because the component can render multiple times when props change after it's mounted once.
-
- Aug 2020
-
medium.com medium.com
-
Think of useRef as a useState that does not trigger a re-rendering of our component.
-
-
felixgerschau.com felixgerschau.com
-
In the two years that I've been working with React professionally, I've never come to a point where I needed to force a re-render. I encourage you to read the article from the beginning if that's what you're here for because usually there's a better way of dealing with React components that aren't updating.
-
- Jan 2020
- Dec 2019
-
material-ui.com material-ui.com
-
server-side rendering is strict about configuration, and the best way to find out what's wrong is to compare your project to an already working setup. Check out the reference implementations, bit by bit.
-
- Nov 2019
-
github.com github.com
-
// require('hammerjs') when in a browser. This is safe because Hammer is only // invoked in componentDidMount, which is not executed on the server. var Hammer = (typeof window !== 'undefined') ? require('hammerjs') : undefined
-
-
stackoverflow.com stackoverflow.com
-
Notice that when you increment the row, ScrollView renders twice but ScrollingDown only renders once receiving only the last version of ScrollView's state.
-
-
reactjs.org reactjs.org
-
you can update the state right during rendering. React will re-run the component with updated state immediately after exiting the first render so it wouldn’t be expensive
Tags
Annotators
URL
-
- Sep 2019
-
codesandbox.io codesandbox.io
-
reactjs.org reactjs.org
-
github.com github.com
-
css-tricks.com css-tricks.com
-
stackoverflow.com stackoverflow.com
- Aug 2019