How to change background color of drawer in react-navigation fully

Viewed 7630

How can I change Background Color of the drawer fully? I don't need to change drawer items need to change the background color of the drawer fully. By default, it's white while I need to make it Green. Is there any demo example?

2 Answers

Old question, but this may help people that are looking for this solution. On createDrawerNavigator you have a drawerConfig property called drawerBackgroundColor.

Example:

import React from 'react';
import { createDrawerNavigator } from 'react-navigation';
import Home from '../screens/Home';
import Screen2 from '../screens/Screen2';

export default createDrawerNavigator({
    Home,
    Screen2
}, {
    drawerPosition: 'left',
    drawerBackgroundColor: '#0000FF',
});

You can read more about it, on React Navigation documentation: https://reactnavigation.org/docs/en/drawer-navigator.html

Related