BlueBaseApp πŸ“Œ

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 β›©Main App Layout. 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

If children are provided to this component, then the children node is rendered instead of β›©Main App Layout. The child components can use BlueBaseConsumer to access BlueBase context.

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.

Last updated