How to use

This section shows the initial walkthrough to use the Beagle library in React Native projects.

Configuration

After you finish the installation, you need to configure the React Native project to use Beagle. To do this, just follow the guide below.

Run one of the commands below to generate the files that will be used by the Beagle library. You can run the command according to your package manager (yarn or npm).

If you use yarn:

yarn beagle

If you use npm:

npx beagle

If the files beagle create already exist, a question will be made asking if you wish to replace them or not.

Two files are created after running this command: src/app.tsx and src/beagle/beagle-service.ts. The first is the entry point for your app, while the second is the beagle configuration.

To view the beagle application in action, make sure that your app renders the component App at src/app.tsx. If you created your project via react-native init, change your index.js file to the following:

import {AppRegistry} from 'react-native';
import App from './src/app';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => App);

Your application is ready to be executed! Once run, the app should show a welcome message loaded remotely from https://usebeagle.io/start/welcome.

Other configurations

👉 For more details on how to use the Beagle Config and the component BeagleRemoteView, please, check the React guide, it works exactly the same!

👉 Beagle React Native is still Beagle Web! Everything in this documentation for Beagle Web is also valid for Beagle React Native. To go deeper into the lib, we suggest reading the articles under Beagle for React Native as well as Beagle for Web

👉 If you wish to know the current development status of Beagle React Native, check it here. Contributions are welcomed!