react-rethinkdb icon indicating copy to clipboard operation
react-rethinkdb copied to clipboard

Create a HoC as an alternative to the mixin

Open chrbala opened this issue 9 years ago • 5 comments

Since mixins don't work with React.Component and are likely on the depreciation path, a HoC is a better interface option for React. What do you think?

chrbala avatar Jul 30 '16 05:07 chrbala

I think it will be great to have a HoC version that people can use as an alternative to the mixin.

Would it be possible to refactor the PR so that it shares most of its logic with the mixin, instead of having the logic in two places?

Also, can we depend on a less strict version of react than "^15.3.0"?

mikemintz avatar Sep 02 '16 23:09 mikemintz

Fixed those two things! My initial pull request was more of a draft, hence those two issues.

chrbala avatar Sep 07 '16 01:09 chrbala

For those who didn't know (like me): HoC = Higher-order Component.

harlantwood avatar Sep 10 '16 23:09 harlantwood

Pushing updates to my fork now

chrbala avatar Sep 11 '16 05:09 chrbala

This is coming along great! I made a few more comments, but otherwise I think it's fine. We'll probably want to add or modify an example to use ES6 classes, but that doesn't need to happen in this PR.

mikemintz avatar Sep 14 '16 05:09 mikemintz