BlueBase
  • πŸ’§Introduction
  • Tutorial
    • 1. Getting Started
      • 1.1 Setup
      • 1.2 Add Plugins
      • 1.3 Create Custom Plugin
    • 2. Backend API
      • 2.1 Create Backend API
      • 2.2 Setup Apollo Client
      • 2.3 Generate Typescript Interfaces
    • 3. Create Screens
      • 3.1 Pending Tasks Screen
      • 3.2 Edit Task Screen
      • 3.3 Task Create Screen
      • 3.4 Tab Navigation
    • 4. CRUD Operations
      • 4.1 Creating Tasks
      • 4.2 Reading Tasks
      • 4.3 Updating Tasks
      • 4.4 Deleting Tasks
    • 5. Enhancements
      • 5.1 Internationalisation
      • 5.2 Theming
      • 5.3 Dynamic Images
      • 5.4 Settings & Configurations
      • User Management
  • Key Concepts
    • 🎑Lifecycle Events
    • ⛩️Main App Layout
    • πŸ”ŒPlugins
      • Plugin API
      • Register a Plugin
      • Making a Plugin Configurable
      • Developing an Analytics Plugin
      • Developing a Logger Plugin
      • Developing a Theme Plugin
    • πŸš‡Filters
    • 🎁Components
      • Components API
      • Registering a Component
      • Accessing Components
      • Higher Order Components
    • 🎨Themes
      • Consuming Selected Theme
      • Customise Themes
      • Customise Components
      • Theme Configs
      • Theme Structure
    • πŸŽ›οΈConfigs
  • API
    • πŸ“ˆAnalytics
    • πŸ“”Logger
    • πŸ“¦BlueBase Modules
    • Registry
  • Guides
    • βœ‚οΈCode Splitting
    • πŸ‘½Migrating to V8
  • Components
    • ActivityIndicator
    • BlueBase
      • BlueBaseApp πŸ“Œ
      • BlueBaseConsumer πŸ“Œ
      • BlueBaseFilter πŸ“Œ
      • ThemeConsumer πŸ“Œ
    • Button
    • ComponentState πŸ“Œ
    • EmptyState πŸ“Œ
    • ErrorState πŸ“Œ
    • Icons
      • Icon
      • DynamicIcon πŸ“Œ
      • PluginIcon πŸ“Œ
    • JsonSchema πŸ“Œ
    • LoadingState πŸ“Œ
    • Noop πŸ“Œ
    • Observers
      • DataObserver πŸ“Œ
      • ErrorObserver πŸ“Œ
      • HoverObserver πŸ“Œ
      • WaitObserver πŸ“Œ
    • StatefulComponent πŸ“Œ
    • Typography
    • View
Powered by GitBook
On this page
  • Usage
  • Custom Context
  • Children
  • Properties

Was this helpful?

Export as PDF
  1. Components
  2. BlueBase

BlueBaseApp πŸ“Œ

PreviousBlueBaseNextBlueBaseConsumer πŸ“Œ

Last updated 6 years ago

Was this helpful?

This is the main app in the BlueBase framework. It is just a React Component, and can either be used as the top most component of your project or it can be embedded in your existing code base.

This component takes care of initialisation and renders the . If children prop is provided, then it renders the children prop instead of the Main App Layout.

System Component πŸ“Œ

This component is shipped with BlueBase Core.

Usage

Use it just like any other react component.

import { BlueBase, BlueBaseApp } from '@bluebase/core';

export const App = () => (
    <BlueBaseApp
        components={{ /* Components Collection */ }}
        configs={{ /* Configs Collection */ }}
        filters={{ /* Filters Collection */ }}
        plugins={{ /* Plugin Collection */ }}
        themes={{ /* Theme Collection */ }}
    />
);

Custom Context

Sometimes, you may want to use custom context. This is especially important when some system functionality may need to be modified before the boot process.

Just create a new object of BlueBase class. And send pass it to the BlueBaseApp component as BB prop when ready.

import { BlueBase, BlueBaseApp } from '@bluebase/core';

const BB = new BlueBase();

// Custom business logic on BB object. i.e. Add filters, etc.

export const App = () => (<BlueBaseApp BB={BB} />);

Children

import { BlueBase, BlueBaseApp } from '@bluebase/core';

export const App = () => (
    <BlueBaseApp>
        {/* This child component will have access to BlueBase context */}
        <CustomComponent />
    </BlueBaseApp>
);

Properties

prop

type

required

default

description

BB

BlueBase

no

-

BlueBase context. If one is not provided a new object will be created.

children

number

no

-

If this prop is provided, BlueBase's own App view will not be rendered, and nodes in this prop will be rendered instead.

components

ComponentCollection

no

-

Collection of components to add in BlueBase's Component Registry.

configs

ConfigCollection

no

-

Collection of configs to add in BlueBase's Config Registry.

filters

FilterNestedCollection

no

-

Collection of Filter to add in BlueBase's Filter Registry.

plugins

PluginCollection

no

-

Collection of plugins to add in BlueBase's Plugin Registry.

themes

ThemeCollection

no

-

Collection of themes to add in BlueBase's Theme Registry.

testID

string

no

-

Used to locate this view in end-to-end tests.

If children are provided to this component, then the children node is rendered instead of . The child components can use to access BlueBase context.

β›©Main App Layout
β›©Main App Layout
BlueBaseConsumer