Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send props to sidemenu at swip #359

Open
yeomann opened this issue Jun 24, 2018 · 1 comment
Open

send props to sidemenu at swip #359

yeomann opened this issue Jun 24, 2018 · 1 comment

Comments

@yeomann
Copy link

yeomann commented Jun 24, 2018

Hi guys, can someone please help me with this?
normally in my home screen when someone click on button to open drawer I'm passing successfully my params this way

Actions.refresh({
	key: "drawer",
	open: true,
	userName: "test name",
	userAccountName: "[email protected]"
});

but when I'm swiping I don't see any props such as UserName and userAccountName
I see that in my Drawer.js I have onOpen method I tried to some stuff nothing happened. since I was using redux I tried to calling Userinfo from there which worked but it automatically closed the drawer as well. which I assume because of re-rendering.

<Drawer
	type="static"
	ref={ref => (this.drawer = ref)}
	open={state.open}
	onOpen={() => {
	console.log("opened drawer");
	this.props.getUserinfoForNav(); // redux call
	console.log("got some userinfo");
	console.log(this.props.userInfo);
	// Actions.refresh({
	// 	key: state.key,
	// 	open: true
	// 	//userName: this.props.userInfo.userName,
	// 	//userAccountName: this.props.userInfo.accountName
	// });
}}

Can someone please help? thanks

Edit: I'm using this lib with react native router flux

@yeomann
Copy link
Author

yeomann commented Jun 24, 2018

well I did it using flux but is that really the solution. isn't there easy way of doing it?

				onOpen={() => {
					console.log("opened drawer");
					//this.props.getUserinfoForNav(); // redux call
					//console.log("got some userinfo");
					//console.log(this.props.userInfo);
					Actions.refresh({
						key: state.key,
						open: true,
						name: this.props.userInfo.name,
						email: this.props.userInfo.email
					});
				}}
				onOpenStart={() => {
					console.log("onOpenStarted");
					this.props.getUserinfoForNav();
				}}
				onClose={() => {
					console.log("closed drawer");
					Actions.refresh({ key: state.key, open: false });
				}}
				content={<SideMenu userData={userData} />}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant