onmyway133 / notes

:notebook_with_decorative_cover: Issues and solutions I found during development, mostly iOS
https://onmyway133.com/
MIT License
63 stars 4 forks source link

RN: native component #392

Open onmyway133 opened 6 years ago

onmyway133 commented 6 years ago

https://facebook.github.io/react-native/docs/native-components-ios https://facebook.github.io/react-native/docs/native-components-android https://github.com/gilbox/react-native-masked-view/blob/master/react-native-masked-view/RNMaskedView/RNMaskedView.m https://codedaily.io/tutorials/13/How-to-bridge-a-Swift-View https://medium.com/@sejoker/writing-android-component-for-react-native-e34802bf3377 https://stackoverflow.com/questions/36533838/do-i-want-to-create-a-native-module-or-a-native-ui-component

onmyway133 commented 6 years ago
import React from 'react'
import { requireNativeComponent } from 'react-native'

const RNGradientView = requireNativeComponent('RNGradientView', 'RNGradientView')

export default class GradientView extends React.Component {
  render() {
    return (
      <RNGradientView />
    )
  }
}
module.exports = RNGradientView