ES export multinomial

in a file of react project, both material and react-redux are used at the same time. When using default export, it is normally used like this:

export defult withStyles(styles)(App)

or

export defult connect(mapStateToProps,null)(App)

what should I do if I want to merge these two together and export them now?

Apr.10,2021

default is misspelled
export default {withStyles(styles)(App),connect(mapStateToProps,null)(App)}

export default is unique. Only one module can be exported. You can use export , import with {} wrap, or merge two into one object to export.


export{
    withStyles(styles)(App),
    connect(mapStateToProps,null)(App)
}

in fact, you can delete default. You can export multiple modules and import import {xxx} from 'fileName';

.

teach people to fish is not as good as teach people to fish http://es6.ruanyifeng.com/-sharpdo.


, try it yourself, find a way,

export default withStyles(styles)(connect(mapStateToProps,null)(App));
Menu