question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Broken when used together with 5.x of react-onclickoutside

See original GitHub issue

I’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.

image

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:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
chodorowiczcommented, May 13, 2016

Cool, thanks! I might take a shot at PR when I find time.

1reaction
rafeememoncommented, May 13, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found