What's missing from the docs? #967
Replies: 15 comments 8 replies
-
Hi, First of all, Thanks for all your work! this is an amazing library, and the docs are pretty great already. I started learning react-spring this year, and will say that it took a while for the concepts to sink in and now I love it and feel like I can actually understand it and have built a few things with it in production. Here are a few ideas
|
Beta Was this translation helpful? Give feedback.
-
Based on some common posts on Spectrum:
If I may let conjecture drive: these posts come from the small problem of the docs' lack of explicit examples using non- |
Beta Was this translation helpful? Give feedback.
-
It would be great to have some examples of an infinite loop animation |
Beta Was this translation helpful? Give feedback.
-
Would be nice to have more examples of usage of lifecycle methods. Like this one with scrolling to the top. It's not trivial and after reading the docs I didin't have a clear vision on how to do this. const Component = () => {
const [, setY] = useSpring(() => ({ y: 0 }));
return (
<button
onClick={() => {
setY({
y: 0,
from: { y: window.scrollY },
onChange: ({ y }) => ref.current.scrollTo(0, y),
});
}}
>
back to top
</button>
);
}; |
Beta Was this translation helpful? Give feedback.
-
Honestly it would be helpful to focus on documenting hooks and functions at a fundamental/core level. The existing documentation is full of wonky examples with poor naming and very little fundamentals. For example, the docs for |
Beta Was this translation helpful? Give feedback.
-
I'd really appreciate giving some insight into manually animating using the |
Beta Was this translation helpful? Give feedback.
-
I don't see anything about testing strategies. Animations are tricky to test of course, also often tricky to get working.
|
Beta Was this translation helpful? Give feedback.
-
Would be nice to have a formal and exhaustive API reference with simple examples. Like lodash or react-router. Document everything! Right now feels very ad hoc and incomplete. |
Beta Was this translation helpful? Give feedback.
-
It would be great if we could have a bigger examples/recipe section. Since "declarative animations" is quite a mindset shift It only really clicked for me once I looked at a bunch of projects and two years later I still usually only look at examples over the documentation. The current examples are amazing but something like clearer variable naming would also really help, stuff like this const calc = (x, y) => [-(y - window.innerHeight / 2) / 20, (x - window.innerWidth / 2) / 20, 1.1] is quite common and makes the examples harder to approach. |
Beta Was this translation helpful? Give feedback.
-
I think showing a transition from one list to another list would be useful. It seems more common than permutations, which are covered fairly well. |
Beta Was this translation helpful? Give feedback.
-
A dedicated section for E.g. it's really hard to find that |
Beta Was this translation helpful? Give feedback.
-
I have been missing thorough simple examples upon which to build. I can see how some are advanced and do not map 1:1 to other libraries or plain css which made it harder to grasp. Do and do not, can and cannot, are also useful. For example: in Up-front interpolation, one can read that "Springs take pretty much everything, they don't just handle numbers.", making explicit what can they not animate (e.g. displays, attributes like flex or grids, etc) would make it clearer for all types of audience, not just those that are already experienced in animations. Questions like this one in spectrum suggest the info is there, it is just hard to make sense out of what's written. |
Beta Was this translation helpful? Give feedback.
-
How can I contribute to the docs? |
Beta Was this translation helpful? Give feedback.
-
it would be helpful to add a section about scroll triggering like that https://youtu.be/X7IBa7vZjmo |
Beta Was this translation helpful? Give feedback.
-
imo it'd be nicer UX if, upon clicking any navigation in the docs, the scroll position didn't move the user back up to the hero area. <3 |
Beta Was this translation helpful? Give feedback.
-
I'll be rewriting the docs from scratch, so I'd like to know! ✌️
Some examples:
react-spring
for a specific purposeBeta Was this translation helpful? Give feedback.
All reactions