Skip to content

Latest commit

 

History

History
98 lines (77 loc) · 2.37 KB

README.md

File metadata and controls

98 lines (77 loc) · 2.37 KB

reactors

[![npm version](https://badge.fury.io/js/reactors.svg)](https://badge.fury.io/js/reactors) [![GitHub version](https://badge.fury.io/gh/co2-git%2Freactors.png)](https://badge.fury.io/gh/co2-git%2Freactors)

===

Framework based on React to build cross-platform apps that run web, mobile and desktop.

To create and run reactors apps, see reactors-cli

Install

npm install reactors

Usage

import React from 'react';
import {
  ListView,
  Text,
  View,
} from 'reactors';

export default function MyAwesomeComponent() {
  return (
    <View>
      <Text style={{fontWeight: 'bold'}}>One code to rule them all:</Text>
      <ListView
        dataSource={[
          'Android',
          'iPhone and iPad',
          'Mac OSX',
          'Ubuntu and Linux',
          'Web browser',
          'Windows 10',
        ]}
        renderRow={(platform) => <Text>{platform}</Text>}
        />
    </View>
  );
}

View a detailed example here.

Core Components

Core APIs

Platform dependent code

You can code for a specific platform:

switch (Reactors.platform) {
case 'mobile':
  // ...
  break;
case 'web':
  // ...
  break;
case 'desktop':
  // ...
  break;
}

Plugins

Check out Reactors plugin in the npm registry. Look for packages starting by reactors-.

Some plugins: