observing/refuse

Name: refuse

Owner: Observe.it

Description: A set of Components that can be shared between React and React-Native

Created: 2015-07-04 14:02:48.0

Updated: 2016-12-18 22:50:07.0

Pushed: 2016-11-17 17:25:06.0

Homepage: null

Size: 9

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

refuse

Refuse is a compatibility layer between React and React-Native. It bridges the gap between DOM elements and View layers by supplying custom components that work identically between React and Native. By restricting yourself to the components that Refuse exposes you can share the components that you write between React (web) and React-Native (mobile).

Installation

The refuse components are released in the public npm registry and can be installed by running the following npm command.

install --save refuse

The --save instructs npm to automatically the installed version to your package.json.

Components

The following components are available in refuse. Click on the component names to learn more about how to use the component and which API methods and properties are available.

Events

The biggest challenge when creating a compatibility layer between Mobile and Web is the different events and their names that are used for interaction. In refuse we've decided to remove all touch and mouse prefixes of the event names and follow the pointer events naming convention where it made sense. These event names can be introduced on components that use interaction. So without further ado:

rt { Interact, Layer, Component, Text } from 'refuse';

rt default class Button extends Component {
nstructor(props) {
super(props)


nder() => {(
<Interact press={this.props.press}>
  <Image src={this.props.icon} width=20 height=20 />
  <Text>{this.props.label}</Text>
</Interact>


License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.