- Let's start this recipe by adding all the imports we'll need in the App.js file in the root of the project. One of these imports is a Menu component, which we'll create in a later step:
import React from 'react';import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';import SideMenu from 'react-native-side-menu';import Menu from './components/Menu';
- Next, let's define the App class and the initial state. state only needs two properties in this app: an isOpen Boolean to keep track of when the side menu should be open, and a selectedBackgroundColor property whose value is a string representing the currently selected background color, as follows:
export default class App extends React.Component { state = { ...