how to understand the code well in the case of cascading high-order functions with multiple arrow functions in es6
const setTitle = (title) => (WrappedComponent) => {
return class extends React.Component {
componentDidMount() {
document.title = title
}
render() {
return <WrappedComponent {...this.props} />
}
}
}
PS asked: I can understand what everyone said, but I have to change it in my head every time. I feel that the readability of the code is not particularly good, or maybe I am too lame. And is it possible to write two layers at most in this way?