react-native-side-menu icon indicating copy to clipboard operation
react-native-side-menu copied to clipboard

Re-render Component right

Open marcussombra opened this issue 7 years ago • 7 comments

every time I open and close the menu, my component (content on the right side, not the menu) re-render. Is this a bug?

marcussombra avatar Apr 04 '18 03:04 marcussombra

Having the same problem. Any change in one of the components of the contentview triggers a re-render of the sidemenu and as such the entire contentview tree too. Is this intended behaviour?

Michiel87 avatar May 09 '18 15:05 Michiel87

@Michiel87 I switched to DRYWER with react-native-flux.

marcussombra avatar May 09 '18 17:05 marcussombra

@marcussombra thanks for the tip

Michiel87 avatar May 09 '18 21:05 Michiel87

It would be great if someone can address this issue, as I still am experiencing it. Here is my setup:

<SideMenu	menu={<Menu />}>
	<Router>
		<Scene key="root" hideNavBar>
			<Scene key="auth">
				<Scene key="login" title="Login" />
			</Scene>
			<Scene key="main">
				<Scene key="projects" title="Projects" leftTitle="☰" onLeft={() => this.setState({ sidebar: { isOpen: !this.state.sidebar.isOpen }})} />
			</Scene>
		</Scene>
	</Router>
</SideMenu>

The library I'm using is the react-native-router-flux for the router. My componens are equipped with React Redux. Thanks in advanced!

side menu bug report

JediahDizon avatar Jun 04 '18 17:06 JediahDizon

It looks like the component doesn't re-render but it actually re-mounts as componentDidMount is called when opening and closing the side menu.

I'll check it out but not promising anything.

AlexCatch avatar Jul 26 '18 07:07 AlexCatch

same problem

long-hp avatar Dec 06 '18 08:12 long-hp

I get this as well, but it does not happen when using the swipe gesture to open the menu.

charliewynn avatar Feb 22 '19 21:02 charliewynn