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.

Bring the mixin back.

See original GitHub issue

Obviously, not everyone is using es6 class syntax with React, and I think as the README points out the discussion about how HOCs should work is not completely formalized. I just feel like the mixin was a better approach than wrapping another component in react-onclickoutside.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Pomaxcommented, Apr 18, 2016

I don’t have to bring anything back, the old versions don’t “go away”, they’re still all available through npm. This is a major version upgrade, because everything changed, so if you don’t want that breaking change, don’t install “the latest” version, but set up your package.json to explicitly use 4.x:

  "dependencies": {
    ...
    "react-onclickoutside": "4.x",
    ...
  }

And voila. Mixin.

But I’m not reintroducing it, Mixins are no longer part of React’s recommendation, the Facebook team has deprecated a ton of them (if you liked the linked state mixin for instance, that’s gone now… and I liked that mixin) and they’re not bringing them back, so there is no value in pretending a mixin still makes sense for code that now targets React 15.

0reactions
Pomaxcommented, Apr 19, 2016

It feels like with React, you’re kind of stuck with “5 months of pretty awesome new stuff” and then a few weeks of porting to the new version. It can certainly get tiring! =)

And hopefully the next few releases of React can bring some clarity to the “official” way to do HOCs, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tutorial:mixin_examples [Fabric Wiki]
This is a collection of frequently used mixins. This page is intended as a cheat sheet. See Mixin Introduction if you haven't already....
Read more >
Mixins - Hypixel SkyBlock Wiki - Fandom
Mixins are RARE God Potion addons that can be used to give God Potions additional effects. Like normal Brews, the Mixin buffs last...
Read more >
Breaking out of a Sass mixin - Stack Overflow
When writing mixins and functions that take arguments, you usually want to ensure that those arguments have the types and formats your API...
Read more >
How to Use Mixins in Sass and Pass Arguments – With Code ...
To put it simply, a mixin is a code block which allows you to write your styles in it and use it throughout...
Read more >
Advanced Mixin Usage Callback Injectors - GitHub
The mixin processor will always inject the callback immediately prior to the matched opcode, and thus using RETURN will always inject a callback ......
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