piral-native
Version:
The Piral framework for use in React Native.
22 lines (21 loc) • 809 B
JavaScript
import { createNativePiral } from './api';
import { createInstanceElement } from './instance';
/**
* Gets a new instantiated native Piral instance using the provided options.
* @param config The configuration to use when creating the Piral instance.
* @param options The options to use when rendering the Piral instance.
* @example
```ts
import { AppRegistry } from 'react-native';
import { getAppInstance } from 'piral-native';
const { app } = getAppInstance();
AppRegistry.registerComponent(appName, () => () => app);
```
*/
export function getAppInstance(config = {}, options = {}) {
const { layout, errors } = options;
const instance = createNativePiral(config);
const app = createInstanceElement(instance, layout, errors);
return { instance, app };
}
//# sourceMappingURL=app.js.map