teact icon indicating copy to clipboard operation
teact copied to clipboard

[features request] add React-Native support

Open emptist opened this issue 8 years ago • 3 comments

Add React Native support.

emptist avatar Apr 28 '16 23:04 emptist

Sounds great! I haven't tried React Native yet. Do you have a sense of what would need to change? PRs welcome!

hurrymaplelad avatar Sep 10 '16 02:09 hurrymaplelad

Thank you! I'm sorry I don't know much of React Native in fact. Just like to see teact there :)

emptist avatar Sep 14 '16 01:09 emptist

Just tried this out in React Native to see what would need to change -- so far, not a lot. From what I can tell, it's only the list of components that is used for the sugar methods that would need to be updated with the list of RN base components, but as a start, this is a fully functional RN app (with a Coffeescript build step added in gulp to precompile)

import React, { Component } from 'react'
import { AppRegistry, View, Text } from 'react-native'
import { crel } from 'teact'

class HelloTeact extends Component
  render: ->
    crel View, ->
      crel Text,
        style:
          marginTop: 40
        'Hello World'

AppRegistry.registerComponent 'hello_teact', () -> HelloTeact

scally avatar Dec 14 '16 23:12 scally