Skip to content

frintjs/frint-react-native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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