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

connected compoenents inside overdrive #6

Closed
arunkjn opened this issue Mar 21, 2017 · 7 comments
Closed

connected compoenents inside overdrive #6

arunkjn opened this issue Mar 21, 2017 · 7 comments

Comments

@arunkjn
Copy link

arunkjn commented Mar 21, 2017

If connected components are used inside overdrive, they do not receive store reference and throw an error

@berzniz
Copy link
Owner

berzniz commented Mar 21, 2017

Can you provide a basic example? I have it working in a react/redux setup without seeing the issue.

@arunkjn
Copy link
Author

arunkjn commented Mar 21, 2017

I will try to replicate it in a fiddle

@green-arrow
Copy link

@berzniz - If it helps any, it looks like an issue with the context of the children not being preserved. I have children of the Overdrive component at various layers that use context for theming purposes, and any time the overdrive component animates, non of the children components are able to get the prop they need off of context and an error is thrown saying it's undefined.

I'm not sure why this is happening, since everything I'm reading says that React.cloneElement should preserve context properly in React 0.14 and up.

@berzniz
Copy link
Owner

berzniz commented Mar 21, 2017

@green-arrow is it breaking while animating? or even before that?

The animation happens on a different ReactDOM.render tree, so I can see why the context might not transfer there. I'll try to see if we can clone that as well.

@green-arrow
Copy link

@berzniz to be honest I can't really tell when it happens. As soon as I reorder some items, they automatically move to the new position (no animation) and I get a console error about the context.

I think the animation not happening is probably an issue on my end, but not sure.

Anujan pushed a commit to Anujan/react-overdrive that referenced this issue Mar 21, 2017
berzniz added a commit that referenced this issue Mar 22, 2017
* Fix components that use context (#6) (#10)
@berzniz
Copy link
Owner

berzniz commented Mar 22, 2017

Thanks @Anujan for providing the fix. It's merged but due to some git magic, the contribution was squashed and your name is not in the contributors list. Sorry.

@berzniz berzniz closed this as completed Mar 22, 2017
@green-arrow
Copy link

Thanks @arunkjn and @berzniz, that worked wonderfully.

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

3 participants