react-navigation-collapsible icon indicating copy to clipboard operation
react-navigation-collapsible copied to clipboard

How to use collapsible with redux state persistence ?

Open nehaj2995 opened this issue 7 years ago • 6 comments

I used this library in my app for collapsible effect with top tab navigation.For that I referred Extra header for tab example .After which I could get a view with header and 3 top tabs ,but the header is not working as collapsible. I'm using redux in my app ,does that affect the collapsible behavior?

const MyProfileTopTab = createMaterialTopTabNavigator(
{
All: {screen: AllTransactions},
Pending: {screen: PendingTransaction},
History: {screen: HistoryTransactions},
},
);

const GroupImageHeader = ({navigation, collapsible}) => {
 const {translateY, translateOpacity, translateProgress} = collapsible;
 return (
 <View
  style={{
    flex: 1,
    justifyContent: 'center',
  }}>
  <ProfileHeader navigation={navigation} />
</View>
);
};

const collapsibleParams = {
collapsibleComponent: GroupImageHeader,
collapsibleBackgroundStyle: {
height: 200,
backgroundColor: 'white',
disableFadeoutInnerComponent: true,
},
collapsibleForegroundStyle: {
height: 100,
 },
};

export default withCollapsibleForTab(MyProfileTopTab, collapsibleParams);

nehaj2995 avatar Nov 18 '19 07:11 nehaj2995

Hm, it should not. And your code looks fine..

Could you specify the version of your react-navigation and react-native?

benevbright avatar Nov 18 '19 07:11 benevbright

"react-navigation": "^4.0.10", "react-native": "0.61.2",

nehaj2995 avatar Nov 18 '19 07:11 nehaj2995

Hi, I tested /example with react-navigation v4.0.10 and react-native 0.60.x. And it still works fine. Perhaps you didn't do this part on your screen? Sorry about the lack of documentation.

https://github.com/benevbright/react-navigation-collapsible/blob/9671b4bcd263f4839ee85ca88a4f379ff15438b0/example/src/TabChild1Screen.js#L43-L52

benevbright avatar Nov 18 '19 20:11 benevbright

Hey, I tried what you suggested in the link above , but still couldn't get the collapsible behavior working. Am I still missing something ?

On Tue, Nov 19, 2019 at 2:14 AM Bright Lee [email protected] wrote:

Hi, I tested /example with react-navigation v4.0.10 and react-native 0.60.x. And it still works fine. Perhaps you didn't do this part on your screen? Sorry about the lack of documentation.

https://github.com/benevbright/react-navigation-collapsible/blob/9671b4bcd263f4839ee85ca88a4f379ff15438b0/example/src/TabChild1Screen.js#L43-L52

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/benevbright/react-navigation-collapsible/issues/92?email_source=notifications&email_token=AJSCVTCH7WP7ULJ2237BTQLQUL5DNA5CNFSM4JOPBPGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEL3CWI#issuecomment-555200857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJSCVTGANCWBG3SIFK7Q6ZDQUL5DNANCNFSM4JOPBPGA .

nehaj2995 avatar Nov 19 '19 04:11 nehaj2995

Hey, I tried what you suggested in the link above , but still couldn't get the collapsible behavior working. The list is displayed in the screen but it's normal scroll is also not working now . Am I still missing something ?

my render() method in child class

const {animatedY, onScroll} = this.props.collapsible;

return ( <AnimatedFlatList style={{flex: 1}} data={this.state.orderList} renderItem={this.renderOrderItem} keyExtractor={(item, index) => String(index)} onScroll={onScroll} _mustAddThis={animatedY} /> );

On Tue, Nov 19, 2019 at 2:14 AM Bright Lee [email protected] wrote:

Hi, I tested /example with react-navigation v4.0.10 and react-native 0.60.x. And it still works fine. Perhaps you didn't do this part on your screen? Sorry about the lack of documentation.

https://github.com/benevbright/react-navigation-collapsible/blob/9671b4bcd263f4839ee85ca88a4f379ff15438b0/example/src/TabChild1Screen.js#L43-L52

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/benevbright/react-navigation-collapsible/issues/92?email_source=notifications&email_token=AJSCVTCH7WP7ULJ2237BTQLQUL5DNA5CNFSM4JOPBPGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEL3CWI#issuecomment-555200857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJSCVTGANCWBG3SIFK7Q6ZDQUL5DNANCNFSM4JOPBPGA .

nehaj2995 avatar Nov 19 '19 05:11 nehaj2995

Hi, sorry for the late reply. Could you confirm you have this one too? https://github.com/benevbright/react-navigation-collapsible/blob/9671b4bcd263f4839ee85ca88a4f379ff15438b0/example/src/TabChild1Screen.js#L58

benevbright avatar Nov 19 '19 23:11 benevbright