Skip to content

Latest commit

 

History

History
60 lines (47 loc) · 864 Bytes

README.md

File metadata and controls

60 lines (47 loc) · 864 Bytes

@redext/micro-framework

Packages for library @redext/micro

Installation

npm install -s @redext/micro-framework
or
yarn add @redext/micro-framework

Use It

import {
  MicroAppContext,
  MicroRouter,
  createMicroAppReact,
  useMicroAppReact,
  withMicroStyles,
  getMicroState
} from '@redext/micro-framework';
// root-config.jsx

import { createMicroAppReact } from '@redext/micro-framework';
import app from './src';

export const { bootstrap, mount, unmount } = createMicroAppReact({
  rootId: __ROOT_ID__,
  rootComponent: () => app
})

if (__MICRO__) {
  window[__APP_NAME__] = {
    bootstrap,
    mount,
    unmount
  }
} else {
  mount({});
}
// src/index.jsx

import { MicroRouter } from '@redext/micro-framework';

const app = (
  <MicroRouter>
    {children}
  </MicroRouter>
)

export default app