1

I'm reading an old project using react class component and they use connect from react-redux like this:

@pageAntdLayout
@injectIntl    
@connect
class List extends Component {
    ....
}

Then I try to find the way using connect from react-redux, it's used like a Higher Order Component, e.g. connect(Component).

So I really wonder is this the way to using HOC in class component?

Drew Reese
  • 165,259
  • 14
  • 153
  • 181
thienms98
  • 167
  • 1
  • 10
  • 1
    Refer: https://stackoverflow.com/questions/32646920/whats-the-at-symbol-in-the-redux-connect-decorator – Shri Hari L Jun 28 '23 at 09:38
  • 1
    If you are looking for what does the syntax means, then it's called 'decorators'. Checkout these blogs: https://blog.logrocket.com/understanding-javascript-decorators/ and https://medium.com/fraight/react-redux-decorators-8b38f3b9ef2f – Shri Hari L Jun 28 '23 at 09:39
  • 1
    Refer: https://github.com/happypoulp/redux-tutorial/issues/87 – Lin Du Jun 28 '23 at 09:42

0 Answers0