React functional component using state

后端 未结 4 1876
生来不讨喜
生来不讨喜 2020-12-06 11:30

I\'m trying to implement a React smart component using functions as shown here https://hackernoon.com/react-stateless-functional-components-nine-wins-you-might-have-overlook

4条回答
  •  情书的邮戳
    2020-12-06 12:07

    If you want to use state in the functional component, then there is one package called recompose, which provides a set of helper functions for stateless function components. There is withState() helper that enables state.

提交回复
热议问题