Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The word "style" in API is confusing #538

Open
mvasin opened this issue Apr 15, 2018 · 2 comments
Open

The word "style" in API is confusing #538

mvasin opened this issue Apr 15, 2018 · 2 comments

Comments

@mvasin
Copy link
Contributor

mvasin commented Apr 15, 2018

I'm digging into react-motion, and I find using the word "style" in the API and documentation very confusing.

Let's start with the opening example from readme:

import {Motion, spring} from 'react-motion';
// In your render...
<Motion defaultStyle={{x: 0}} style={{x: spring(10)}}>
  {value => <div>{value.x}</div>}
</Motion>

There is no styling animation here at all. And it takes time and frustration to figure out why this "style" doesn't style anything, has no relation to stylistic appearance, and still is called "style".

The way I see it, react-notion basically "springs" stuff, and the stuff does not have to be CSS styles. So there should be a better word for reflecting this purpose of the library (if I get the purpose right).

The same confusion applies to TransitionStyle objects and pretty much all the *style* names.

Maybe "motion" could be a better word, as it reflects the fact that <Motion />, <StaggeredMotion /> and <TransitionMotion /> take some static props and bring them to motion for their children. Any other suggestions are welcome.

I create this issue to see if someone else feels the same and consider renaming before the library reaches 1.0.

@ghost
Copy link

ghost commented Apr 28, 2018

👍Agreed

@mb8z
Copy link

mb8z commented Jun 6, 2018

Oh, couldn't agree more. It took me a while to get used to this naming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants