zobeirhamid / react-native-scrollable-navigation-bar

Respecting navigation bar for scrolling screens.
https://zobeirhamid.github.io/react-native-scrollable-navigation-bar/
MIT License
267 stars 29 forks source link

React state update issue on unmounted component #11

Closed hirbod closed 4 years ago

hirbod commented 4 years ago

The first time the element gets mounted, as soon as I scroll up, I receive 2 yellow warnings

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.%s, the componentWillUnmount method, in HeaderNavigationBar (at Context.js:32) in _class (at Header/index.js:54) in Header (at Context.js:32) in _class (at src/index.js:200) in Header (at Container.js:157)

                <ScrollableNavigationBar
                    transitionPoint={180}
                    title="Chats"
                    titleStyle={{color: 'white'}}
                    buttonColor="white"
                    headerBackgroundColor="#b7cc23"
                    borderColor={undefined}
                    headerTitle={"Chats"}
                    contentContainerStyle={styles.contentContainer}
                    rightIcons={[<NavigationBarIcon name="ios-create" />]}
                    showsVerticalScrollIndicator={true}
                    scrollIndicatorInsets={{
                        top: 135,
                        left: 0,
                        bottom: 0,
                        right: 0
                    }}
                >
hirbod commented 4 years ago

@zobeirhamid I tried to fix this, but actually not a clue where this comes from.. but its annoying