FormidableLabs / radium

A toolchain for React component styling.
http://formidable.com/open-source/radium/
MIT License
7.39k stars 308 forks source link

Wrapping Component with Radium & Connect #661

Open olegkalyta opened 8 years ago

olegkalyta commented 8 years ago

Spent a few hours investigating why on one of my components Radium media queries works fine, and on another, getting

0:[object Object]

The reason was decoration order:

@connect(createSelector(args), mapDispatchToProps) class SharePanel extends {} return Radium(SharePanel);

@Radium @connect(createSelector(args), mapDispatchToProps) class SharePanel extends Component {} return SharePanel;

@connect(createSelector(args), mapDispatchToProps) @Radium class SharePanel extends Component {} return SharePanel;

Hope it will save time for others

alexlande commented 8 years ago

Thanks @olegkalyta! We'll work on updating the docs to better reflect this.

TheIrvingBarajas commented 8 years ago

Hey @olegkalyta ,

I'm having trouble implementing @Radium with @Connect. Do you have any open source projects with an example of this?

olegkalyta commented 8 years ago

Hi @IrvingAxelB unfortunately no :( send me pm, will try to help