Skip to content

hyperhype/react-native-hyperscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-hyperscript

Hyperscript syntax for React.js React Native markup.

Usage

var h = require('react-native-hyperscript');
var React = require('react-native');

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
});

var AwesomeProject = React.createClass({
  render: function() {
    return h(View, { style: styles.container }, [
      h(Text, { style: styles.welcome }, 'hello from React Native!')
    ])
  }
});

Documentation

h(component, properties, children)

Returns a React Native element.

  • component Object - A React-native component.
  • properties Object (optional) - An object containing the properties you'd like to set on the element.
  • children Array|String (optional) - An array of h() children or a string. This will create child elements or text, respectively.

Releases

No releases published

Packages

No packages published