问题
I'm using React-navigation module, and I Created DrawerContent
and I Got this Error:Check the render method of "Drawer Sidebar"
How Can I Fix this Error?
Default Code is ok:contentComponent: props => <ScrollView><DrawerItems {...props} /></ScrollView>
My new Code is Not ok:contentComponent: DrawerContent
andconst DrawerContent = (props) => (<ScrollView><DrawerItems {...props} /></ScrollView>)
I opened This Issue too: (https://github.com/react-community/react-navigation/issues/2175)
回答1:
Solved ✔️contentComponent: props => <DrawerContent {...props} />
回答2:
I solved using this:
contentComponent: props => <DrawerNavigatorItems {...this.props} />
来源:https://stackoverflow.com/questions/45167415/check-the-render-method-of-drawer-sidebar