Bring the mixin back.
See original GitHub issueObviously, 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:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top 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 >
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
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:
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.
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.