Skip to content

Commit b46dcb5

Browse files
committed
2 parents c192c9f + 57f2565 commit b46dcb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ You'll find varying implementations under [/dist/addons](https://github.com/drcm
151151
```jsx
152152
import { TimingAnimation, Easing } from 'react-spring/dist/addons'
153153

154-
<Spring impl={TimingAnimation} config={{ delay: 200, duration: 1000, easing.linear }} ...>
154+
<Spring impl={TimingAnimation} config={{ delay: 200, duration: 1000, Easing.linear }} ...>
155155
```
156156

157157
#### Keyframes ([Demo](https://codesandbox.io/embed/zl35mrkqmm))
@@ -239,6 +239,8 @@ Et voilà! `Header` animates on prop changes! Props that `Spring` doesn't recogn
239239
---|---
240240
<sub>Most libraries animate by having React recalculate the component-tree. Here it attempts to animate a component consisting of ~300 sub-components, plowing through the frame budget and causing jank.</sub> | <sub>React-spring with the `native` property renders the component *only once*, from then on the animation will be applied directly to the dom in a requestAnimationFrame-loop, similar to how gsap and d3 do it.</sub>
241241

242+
---
243+
242244
By default we'll render every frame (like in the image on the left) as it gives you more freedom (for instance this is the only way that you can animate React-component props). In situations where that becomes expensive use the `native` flag. The flag is available for all primitives (Spring, Transition & Trail, Keyframes, Parallax is native by design). **Try doing this in all situations where you can**, the benefits are worth it. Especially if your animated component consists of large subtrees, routes, etc.
243245

244246
Just be aware of the following conditions:

0 commit comments

Comments
 (0)