Broken when used together with 5.x of react-onclickoutside
See original GitHub issueI’m using in my project latest 5.1.0, but it unfortunately conflicts with the one bundled with react-datepicker
. When I downgrade to 4.x all starts to works.
You can see in this sample bin that when react-onclickoutside
5.1.0 is included in package.json webpack fails importing react-datepicker
http://www.webpackbin.com/EyiNOac-W
Locally I get following stacktrace
invariant.js?4599:38 Uncaught Invariant Violation: ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object.
I suppose webpack serves 5.x to datepicker what obviously fails, since their exports are not compatible.
Temporary solution: I’ve downgraded my local react-onclickoutside
to 4.9
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
Problem when using hooks + multiple components · Issue #329
Hi everyone, I'm having a problem, I've been using this library for a while working 100%. ... import React from "react" import onClickOutside...
Read more >react-onclickoutside - npm
An onClickOutside wrapper for React components. Latest version: 6.12.2, last published: 7 months ago. Start using react-onclickoutside in ...
Read more >Accessibility - React
To illustrate this, let's look at a prolific example of broken accessibility caused by click events. This is the outside click pattern, where...
Read more >i tried to Polyfill modules in webpack 5 but not working (Reactjs)
How fix "BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default" error? 0 · Getting this error...
Read more >A complete guide to React refs - LogRocket Blog
Learn how to use React refs, and why it's important to use them only when React can't handle a function call through its...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Cool, thanks! I might take a shot at PR when I find time.
Yeah, in that case the dependencies are set up correctly and unfortunately I don’t think there’s anything else we can do on the
react-datepicker
end – sounds like a question for webpack now.As an aside, updating our version of
react-onclickoutside
is on the to-do list and a PR doing this would be welcome =) There are some API changes that need to be sorted out but should be pretty straightforward.