Kureev / react-native-side-menu

Side menu component for React Native
MIT License
2.21k stars 435 forks source link

Re-render Component right #335

Open marcussombra opened 6 years ago

marcussombra commented 6 years ago

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

Michiel87 commented 6 years ago

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?

marcussombra commented 6 years ago

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

Michiel87 commented 6 years ago

@marcussombra thanks for the tip

JediahDizon commented 6 years ago

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

AlexCatch commented 6 years ago

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.

long-hp commented 5 years ago

same problem

charliewynn commented 5 years ago

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