javascript - Material UI v1 with Redux - How to export -


i trying make use of material-ui v1 stajuan's redux-saga login template shown here. so, want merge export default thing of two, in other words combine 2 functions exporting default class:

import react, {component} 'react'; import { connect } 'react-redux'; import { withstyles, createstylesheet } 'material-ui/styles';  // redux function select (state) {     return {     data: state     } }  // material ui v1 const stylesheet = createstylesheet(theme => ({     // ... }));  // class exported class login extends component {     // ...     render () {         // ...     }  }  // h o w   t o   m e r g e   t h o s e ? ? ? // export default connect(select)(login); // export default withstyles(stylesheet)(login); 

the last 2 commented-out lines of code above statements combined in case.

you need install npm install recompose or yarn add recompose

and on export section

export default compose(     withstyles(styles, {         name: 'app',     }),     connect(), )(appframe); 

or can do:

export default withstyles(styles)(connect(select))(cart));


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -