在React Native中使用带有react-router-flux的react-native-side-menu菜单

时间:2018-07-21 20:27:32

标签: react-native react-native-router-flux

我想查看一个侧面菜单。出现侧面菜单,但控制台中出现错误:

Warning: Can't call setState (or forceUpdate) 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 the 
componentWillUnmount method.

我不知道这是否是正确的放置方式,但我希望它占据屏幕的所有高度,这就是为什么我将其放置在这里:

<Provider store={store}>
      <SideMenu menu={<Menu navigator={navigator}/>}
            isOpen={true}
            menuPosition="right"
            >
        <Router navigationBarStyle={{ backgroundColor: '#262628'}} titleStyle={{color: "#FFF"}}>
          <Scene key="root" hideNavBar>
            {/* Tab Container */}
            <Scene
              key="login"
              component={Login}
              initial
            >

            </Scene>
            <Scene
              key="tabbar"
              tabs={true}
              tabBarStyle={{ backgroundColor: '#262628' }}
              tabBarPosition={'bottom'}
              showLabel = {false}
            >

              <Scene key="tabhome"  renderRightButton={<ButtonsHome/>} title="Publicaciones" icon={TabIcon} iconName="md-home">
                <Scene
                  key="home"
                  component={Home}
                />
              </Scene>



              <Scene key="tabprofile" title="Perfil" icon={TabIcon} iconName="md-person">
                <Scene
                  key="profile"
                  component={Profile}
                />
              </Scene>
            </Scene>
          </Scene>
        </Router>
        </SideMenu>
      </Provider>

即使我删除了sideMenu标签的所有属性,我也有错误,所以我认为问题必须出在那个sidemenu标签本身上。请告诉我放置它的错误,但这就是我能找到的全部与这两个相关的库

0 个答案:

没有答案