-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
API change proposal for useTransition #393
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
Comments
Makes sense! The only thing i don't like is that keys is optional right now, here it would take a fixed spot with this approach. On the other hand, maybe we're better off enforcing keys, making users think about this, because default keys (props => props) can fail. |
Willing to accept a PR for this or you want to do it yourself? |
Friendly reminder :) still interested in this API change? |
@yuchi you want to make the PR? i think this is a good change - makes total sense to do it that way. |
btw, some new ideas here: #425 |
This was implemented in v8.0.0 |
Description
Since configuration for a transition is usually static or a static composition of functions, it makes sense to define it outside of the component body:
The current approach of having a single configuration argument makes this slightly less usefull since you need to spread that static configuration over the object that includes
items
andkeys
too.Proposal
I propose to change the API to this:
This reduce the need for the creation of a pretty useless object at render time.
Additional note
This makes the API more coherent with
useTrail
:The text was updated successfully, but these errors were encountered: