Datta
Datta Able - React
Datta Able - React
  • Documentation
  • Pre-requisites
  • Quick Start
  • Folder Structure
  • State Management
  • Authentication
    • Switch to Auth0
    • Switch to Firebase
  • Axios API Calls
  • Routing
  • Project Configuration
  • Theme Layouts
  • Theme/Style Configuration
  • Integration
    • Seed
    • Comparison
  • Dependencies
  • Support
  • Changelog
Powered by GitBook
On this page
  • Context API
  • State

State Management

Managing context, state and hooks

Context API

Context provides a way to pass data through the component tree without having to pass props down manually at every level.

We are using context for login methods - Auth0, JWT, and Firebase.

State

Our application state is always kept in plain JavaScript objects and arrays which means you may not put other things into the state - no class instances, built-in JS types like Map / Set Promise / Date, functions, or anything else that is not plain JS data

Based on this information, we should now be able to describe the kinds of values we need to have inside our state:

import { CONFIG } from '../config/constant';

const initialState = {
  ...CONFIG,
  isOpen: [], //for active default menu
  isTrigger: [] //for active default menu, set blank for horizontal
};

PreviousFolder StructureNextAuthentication

Last updated 11 months ago