Expobook allows you to present and develop react-native UI components in a standalone dev environment within an expo app.
Install expobook.
$ npm i expobook
Create your expobook entry file.
$ touch expobook.js
Add components to expobook.
// ./expobook.js
import React from 'react';
import createExpobook from 'expobook';
import MyButton from './components/button';
const expobook = createExpobook();
expobook.add('My Button', () => <MyButton>Hello</MyButton>);
expobook.add('Another Button', () => <MyButton>Goodbye</MyButton>);
export default expobook.build();
Run expobook:
$ ./node_modules/.bin/expobook
OR better yet Add "expobook": "./node_modules/.bin/expobook"
to "scripts"
in your package.json and just run npm run expobook
.
- Enable custom
exp
cli config pass through - Fix paths so that
__expobook__
becomes.expobook