You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+19-25Lines changed: 19 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,15 @@
4
4
5
5
# Why 🤔
6
6
7
-
React-spring is a cooked down fork of [Facebooks animated](http://animatedjs.github.io/interactive-docs/). It is trying to bridge it with Chenglou's [React-motion](https://github.com/chenglou/react-motion) because both have their pros and cons but could definitively benefit from one another:
7
+
React-spring is a cooked down fork of [Facebooks animated](https://github.com/animatedjs/animated). It is trying to bridge it with Chenglou's [React-motion](https://github.com/chenglou/react-motion) because both have their pros and cons and could definitively benefit from one another:
*[x] Declarative api that doesn't involve manual management of animations
12
-
*[x] Covers most of the essentials (springs, lists, transitions, reveals, staggered animations)
13
-
*[ ] Performance can suffer because components are re-rendered every frame with fresh props
14
-
*[ ] Can't interpolate between raw state as it doesn't know colors, paths, gradients, etc.
15
-
16
-
#### Animated
17
-
18
-
*[x] Interpolates most web privimites, units and patterns
19
-
*[x] Efficiently writes to the dom directly instead of re-rendering components frame by frame
20
-
*[ ] Managing and orchestrating handles (starting/stopping/waiting/cleaning) can become a real chore
21
-
*[ ] Missing essential prototypes like mount/unmount transitions
22
-
23
-
As you see, they're polar opposites. React-spring inherits React-motions api, but simplified, while adding more primitives and being able to interpolate. It also has support for native rendering, where components animate directly in the dom.
15
+
React-spring inherits react-motions api (and simplifies it), has lots of primitives (springs, trails, transitions, reveals, parallax), can interpolate mostly everything (colors, gradients, percentages, degrees, svg-paths, arrays, etc.) and last but not least, can animate by committing directly to the dom instead of re-rendering a component frame-by-frame.
24
16
25
17
# Overview 🔭
26
18
@@ -100,7 +92,7 @@ Given a single child instead of a list you can reveal components with it.
Et voilà! `Header` animates on prop changes! Props that `Spring` doesn't recognize will be spread over the receiving component, including `children` if you use `render` to refer to the render-child.
@@ -146,7 +140,7 @@ By default we'll render the receiving component every frame as it gives you more
146
140
147
141
Just be aware of the following conditions:
148
142
149
-
1. It only animates standard styles and element props, the values you receive *are opaque objects, not regular values*
143
+
1. It only animates element styles and attributes, the values you receive *are opaque objects, not regular values*
150
144
2. Receiving elements must be `animated.[elementName]`, for instance `div` becomes `animated.div`
151
145
3. If you need to interpolate styles use the `template` string literal
0 commit comments