atlassian / react-sweet-state

Shared state management solution for React
https://atlassian.github.io/react-sweet-state/
MIT License
871 stars 55 forks source link

How to use with class component #117

Closed kabus202 closed 3 years ago

kabus202 commented 3 years ago

I was wondering how to access the createHook method within a class component for example in componentDidMount() ?

Dahaden commented 3 years ago

You cant use hooks with react class components. However, you can create other function components to call the hooks to call these for the class component https://infinum.com/the-capsized-eight/how-to-use-react-hooks-in-class-components