JungHsuan / react-native-collapsible-tabview

This is only an implementation of tabview with collapsible header.
MIT License
276 stars 61 forks source link

How to implement in class component #8

Closed Lzadhito closed 3 years ago

Lzadhito commented 3 years ago

Any tutorial how to implement it in class component? I'm already write lot of my codes with class component and its kinda hard to implement this while this code written in hooks

JungHsuan commented 3 years ago

Hi, you will need to do something like:

  1. useRef variable to this.xxx
  2. useState to normal state.
  3. useEffect to componentDidMount and don't forget to remove the listener in componentWillUnmount
Lzadhito commented 3 years ago

Hi, you will need to do something like:

  1. useRef variable to this.xxx
  2. useState to normal state.
  3. useEffect to componentDidMount and don't forget to remove the listener in componentWillUnmount

thank you 👍