Когда мы передаем функцию в функцию в качестве аргумента, функция, которую мы передаем в нее, имеет собственный параметр, но почему параметр становится аргументом следующей возвращаемой функции?
function combineStyles(...style){
return function CombineStyles(theme){}
}
const s1 = theme => ({
toolbar: {
backgroundColor: theme.palette.primary.main,
color: '#fff',
...theme.mixins.toolbar,
},
});
const combinedStyles = combineStyles(s1);
export default withStyles(combinedStyles)(MyComponent);
// While i am log it, i got same result
const s1 = theme => console.log(theme);
// Same as :
function combineStyles(...style){
return function CombineStyles(theme){ console.log (theme) }
}