Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyperhype/react-native-hyperscript
:beer: hyperscript syntax for React Native
https://github.com/hyperhype/react-native-hyperscript
hyperscript react-native
Last synced: about 2 months ago
JSON representation
:beer: hyperscript syntax for React Native
- Host: GitHub
- URL: https://github.com/hyperhype/react-native-hyperscript
- Owner: hyperhype
- License: mit
- Created: 2015-11-03T07:48:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-03T07:49:59.000Z (about 9 years ago)
- Last Synced: 2024-11-01T13:38:42.270Z (2 months ago)
- Topics: hyperscript, react-native
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 20
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.markdown
- Changelog: history.markdown
- License: LICENSE
Awesome Lists containing this project
README
# react-native-hyperscript
# a fork of [react-hyperscript](https://github.com/mlmorg/react-hyperscript) [![Build Status](https://travis-ci.org/mlmorg/react-hyperscript.png?branch=master)](https://travis-ci.org/mlmorg/react-hyperscript)
Hyperscript syntax for ~~React.js~~ React Native markup.
## Usage
```js
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.