-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Using react-reactonlickoutside with React.forwardRef results in a runtime error #297
Comments
I am very glad they finally added this as a thing, because it solves a problem that is inherent to HOC implementations. That said, this is absolutely worth updating the code for, and then releasing it as a new major version that does away with the whole instance forwarding code this HOC has had to use for years now. As per https://reactjs.org/docs/forwarding-refs.html#note-for-component-library-maintainers - let's use this! And mark it as breaking change. /cc @Andarist |
Sure - doing a major release for this is cool 👍 |
Any update on that? |
Any updates on this fix? |
@Andarist could you please update your PR |
is there any workaround now to use with styled-components? |
#326 should be able to work with forwardRef without a breaking change |
I've not had any free time to look at this before today, but I've left some questions on that PR - there's some odd things going on in it and I'd like to make sure those are all intentional. |
Using the following component that uses React.forwardRef:
Leads to the following error:
As
styled-components
usesReact.forwardRef
,react-onclickoutside
cannot be directly used with styled components.Related to: #293
The text was updated successfully, but these errors were encountered: