-
Notifications
You must be signed in to change notification settings - Fork 208
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
Allow usage of ref on custom components #273
Comments
Looks like we can't actually make this backwards compatible. I think we should release a new major version that no longer uses |
@brigade-slack I'm happy to make a PR for this if you agree. |
I’m in favor of the breaking change. Perhaps coupled with a note in the readme about needing to use an older version for |
@trotzig I'm also having quite a bit of frustration with the test suite. How do you feel about updating to Jest and Enzyme? The current test suite is quite crappy to use. |
That sounds like a good idea in general. I remember setting this up years ago when neither of those were a thing. The only thing I would worry about is that the code relies on getting proper measurements from the browser. I’m not sure jsdom will provide those unless we mock things (which might be okay). |
OK I'll have a look at updating the tests in a separate PR and see how it goes. |
Any progress on this? I'm trying to use this library with styled-components@4 but it won't work |
It was a pain getting the tests working and I ran out of time working on it. I forked it and fixed it at My company Casalova is using it in production and everything works. |
Is #278 addressing this concern perhaps? |
@trotzig yeah, my PR is fixing this problem. With my PR |
Hi @Andarist but for your change, this line of code, when styled-component pass to I need to write it as below code to let the waypoint works fine again:
|
@twxia Which version of styled-components do you use? |
@Andarist styled-components@latest (4.1.3) I think all of v4 can't work well in that change |
Somehow I've made a mistake and was calling isForwardRef with wrong argument, I've prepared a PR with a fix for this just now. |
React 16.3 introduced the concept of forwarding refs as a first-class citizen. We can remove the usage of
innerRef
and just use the regularref
prop. We can make this backwards compatible by usinginnerRef
if it exists however we shouldn't throw if a custom component doesn't haveinnerRef
-ref
can work just fine.This library currently breaks with
styled-components@4
due to this issue.The text was updated successfully, but these errors were encountered: