ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 416 forks source link

Cannot rerender TabNavigator.Item's view after redux data change. #180

Closed didiself closed 6 years ago

didiself commented 6 years ago

Hi, I use redux in the item component , but it's cannot rerender the view after redux data changed.

After several repeated attempts, it's realize in componentWillReceiveProps function like this:

componentWillReceiveProps(props) {
    const { dispatch } = this.props
      dispatch(someUpdateDataFunction()).then(() => {
        this.forceUpdate()
      })
    }
  }

It is a bug ??? or any suggestion ??