-
-
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
Compatibility Issues Between "React" and "React-OnClickOutside" Libraries. #395
Comments
I assume you kept the class notation rather than rewriting things to functions with hooks, like the React folks have been pushing for since 16.5? |
Hi Pomax, Thank you for your reply. I am working on a large project that has been in development for many years. As a result, a significant portion of our components are still written using class notation. |
Thanks, just wanted to make sure. I don't suppose you have a small self-contained example that can be dropped into the issue for testing? |
Hi pomax , thank you very much for your willingness to help. Unfortunately, I was not able to create an example that I could share. This is a behavior that also occurs in the old version of React, but for some reason, the event does not happen for the component that was just registered. Thanks,or |
Remember that an example doesn't need to be "your code". If you're seeing it do the wrong thing, it should be possible to create a standalone "new code" setup with a few dummy components that shows things going wrong. (because if you can't, there aren't really any steps to reproduce the problem, which means we can't make a test case) |
Hi Pomax, |
Anyway, I created a pr |
hm, I don't see a PR in the open PR list? |
|
Im also facing the same issue. Was working fine for React 16.x, migration to 18.2 causes the issue. Im using Class components. |
I'm going to have to point at https://react.dev/reference/react/Component at this point though.
React went all in on functional components and hooks, whether we like it or not (I sure don't, the amount of horrible code that hooks gave rise to is truly staggering). There is just no point in trying to fight that, and functional components don't need this HoC anymore. And I'd be very surprised if they don't flat out remove the |
published v6.13.1, but I will reiterate here that if a project relied on this HoC enough for this PR to still be merged in: please read the first paragraph of the README.md and see what you can do. |
Our project currently has 'react-onclickoutside': '^6.7.0' installed.
We recently updated our project from 'react': '^16.2.0' to 'react': '^18.2.0'.
However, we have encountered an issue with a component that is wrapped in onClickOutside.
After upgrading to the new version of React, the handleClickOutside function is called immediately after the component is created, without the user performing any action.
When we rolled back to 'react': '^16.2.0', the problem was resolved.
We would like to know if there is a version of 'react-onclickoutside' that is supported by 'react': '^18.2.0'?
The text was updated successfully, but these errors were encountered: