reflux / refluxjs

A simple library for uni-directional dataflow application architecture with React extensions inspired by Flux
BSD 3-Clause "New" or "Revised" License
5.36k stars 330 forks source link

React.PureComponent #514

Closed timoj closed 7 years ago

timoj commented 7 years ago

It seems that I can't use the purecomponent via reflux. Is there another way to extend my classes with the purecomponent from react other then extends Reflux.PureComponent?

BryanGrezeszak commented 7 years ago

I've actually been thinking about making a Reflux.PureComponent, but it was sorta on the backburner. I'll move it up and see if I can get it done sooner for ya.

BryanGrezeszak commented 7 years ago

No idea why I didn't think of this earlier, but you can utilize the static .extend method to extend whatever class you want...including React.PureComponent.

class Example extends Reflux.Component.extend(React.PureComponent)

Works perfectly.

I still plan on making the prettier extends Reflux.PureComponent version...but for now that'll work wonderfully.

BryanGrezeszak commented 7 years ago

Reflux.PureComponent should now be in as of v6.3.0.