-
Notifications
You must be signed in to change notification settings - Fork 137
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
Add a class when component is appearing / disappearing #45
Comments
hi @floo51! this is a neat idea, though i fear opening up/leaking the abstraction outside of the current constraints may be harmful in the longterm. i am not entirely opposed to the idea, though i wonder if there is a workaround given the current api. can you think of any other alternatives than affixing a new class name? |
Hmm we could try building a HOC so we could wrap components like: import React from 'react';
import { withTransitionState } from 'react-router-transition';
const MyComponent = ({transitionState}) => (
<div className={transitionState === 'mounting' ? 'whatever': 'something else'}></div>
);
export withTransitionState(MyComponent); It gives control over what we wanna do when transitioning, wether we want to add a class or do something else. |
its there a way to set className to the wrapper, only when transition is runing? |
I am also having this problem. |
I'm going for a full material design app and I'd like to implement more transitions inside the views when they appear or disappear.
Something like this, with the ❤️ icon appearing while the whole view is transitionning, taken from official guidelines, § Motion is clear*
I think that just adding a
enter
andleave
class to the component whenever a transition starts would be enough.Can you think of any other way ? Would you accept a PR on this ?
The text was updated successfully, but these errors were encountered: