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

How to make drawer navigation? #2149

Closed
bezenson opened this issue Jul 31, 2017 · 2 comments
Closed

How to make drawer navigation? #2149

bezenson opened this issue Jul 31, 2017 · 2 comments

Comments

@bezenson
Copy link
Contributor

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.14
  • react-native v0.46.4

I can't understand how to make navigator with DrawerLayoutAndroid.

Here is my code:

const Home = (props) => {
  return (
    <View>
      <Text onPress={() => Actions.test({ title: 'hey' })}>
        Home
      </Text>
    </View>
  );
}

const Test = (props) => {
  return (
    <View>
      <Text>Test</Text>
    </View>
  );
}

export default class RouterTest extends Component {
  render() {
    return (
      <Router>
        <Scene>
          <Scene key="drawer" tintColor={'#f00'} drawer component={DrawerLayoutAndroid} renderNavigationView={Test} title={'test'}>
            <Scene key="home" component={Home} title={'Home'} initial />
            <Scene key="test" component={Test} />
          </Scene>
        </Scene>
      </Router>
    );
  }
}

Drawer works fine. In navbar I see title test. And content is not visible. Just blank page. So what I am doing wrong.

@bezenson bezenson changed the title How to make drawer navigation How to make drawer navigation? Jul 31, 2017
@xinhash
Copy link

xinhash commented Jul 31, 2017

You don't have a scene with key="root" . It will be parent to key="home and key="test" . Check Example/Example.js for better understanding

@aksonov
Copy link
Owner

aksonov commented Jul 31, 2017

Check breaking changes section, now containers cannot have 'component', but 'contentComponent' instead. And right, check Example project for more details

@aksonov aksonov closed this as completed Jul 31, 2017
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

3 participants