Last active
December 20, 2017 04:43
-
-
Save threepointone/de05fd8bf8de79f15b5d994b1c5d5b6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rn.js | |
import {createElement} from 'react' | |
import {View, Text, Image} from 'react-native' | |
const map = { view: View, text: Text, image: Image } | |
export default function rn(type, props, ...children){ | |
return createElement(map[type] || type, props, ...children) | |
} | |
// app.js | |
// @jsx rn | |
import rn from './rn' | |
// ... | |
<view> | |
<text> what up </text> | |
<image source={}/> | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment