UNPKG

piral-core

Version:

The core library for creating a Piral instance.

24 lines 963 B
import * as React from 'react'; import { createInstance } from './createInstance'; import { PiralView, RegisteredRouter } from './components'; import { PiralContext } from './PiralContext'; /** * Represents the Piral app shell frame. Use this component together * with an existing instance to render the app shell. * Includes layout and routing handling. Connects the Piral context * and the React router to the generated views. * * @example ```jsx const app = ( <Piral instance={yourPiralInstance}> <Define name="Layout" component={MyLayout} /> </Piral> ); ``` */ export const Piral = ({ instance = createInstance(), breakpoints, children }) => (React.createElement(PiralContext, { instance: instance }, React.createElement(RegisteredRouter, { publicPath: instance.context.navigation.publicPath }, React.createElement(PiralView, { breakpoints: breakpoints }, children)))); Piral.displayName = 'Piral'; //# sourceMappingURL=Piral.js.map