Home

Awesome

frint-react-native npm Build Status License

React Native integration for FrintJS.

Install

You should already have these FrintJS dependencies first:

$ npm install --save frint frint-react

Now you can install the package for React Native integration:

$ npm install --save frint-react-native

Usage

You can write a regular FrintJS application with React first:

// App.js
import { createApp } from 'frint';
import React from 'react';
import { View, Text } from 'react-native';

function Root() {
  return (
    <View>
      <Text>Hello World!</Text>
    </View>
  );
}

const App = createApp({
  name: 'MyReactNativeProject',
  providers: [
    {
      name: 'component',
      useValue: Root,
    },
  ],
});

export default App;

Now instantiate and register it to React Native:

// index.js
import { register } from 'frint-react-native';

import App from './App';

const app = new App();
register(app);

License

MIT