@redext/micro-framework
v0.0.1-staging-89
Published
Packages for library @redext/micro
Downloads
174
Readme
@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