-
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
No way to use wrapperComponent: false with AnimatedSwitch #83
Comments
I think I figured it out. In |
This appears to be by design remix-run/react-router#4627 I think it would make sense to export an |
I replaced that const TransRoute = ({component, style, ...props}) => (
<Route {...props} render={props => React.cloneElement(component, {style, ...props})} />
); And it works. |
Awesome! I’ll give it a go
…On Fri, 24 Nov 2017 at 15:03, Jeff Wen ***@***.***> wrote:
I replaced that Route element with this:
const TransRoute = ({component, style, ...props}) => (
<Route {...props} render={props => component({style, ...props})} />
);
And it works.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#83 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZ9LVck55DZg2sEAUzt26FpgGCMWTMmks5s5trLgaJpZM4QmDuD>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a use case where I need fine control over styles – specifically I need to add more styles to the element with the tweening styles.
{ wrapperComponent: false }
seemed like the perfect option as it usescloneElement
and injects the styles.However it turns out there is noway to consume the injected style prop (at least with
AnimatedSwitch
) – cloned element is actually an internal providedSwitch
component.Is there something I am missing?
I came up with a work around I thought I would share using recompose and React context.
Is there a way to provide the
style
prop without needing to use context?Thanks for the awesome library! :)
The text was updated successfully, but these errors were encountered: