Separate React from React Native

This commit is contained in:
ahanriat 2016-05-06 11:35:18 +02:00
parent 14bd1dd811
commit 9c8e5ab062
4 changed files with 23 additions and 13 deletions

View File

@ -4,13 +4,14 @@
*/ */
'use strict'; 'use strict';
var React = require('react-native'); var ReactNative = require('react-native');
var React = require('react');
var { var {
AppRegistry, AppRegistry,
StyleSheet, StyleSheet,
Text, Text,
View, View,
} = React; } = ReactNative;
var Basic = React.createClass({ var Basic = React.createClass({
render: function() { render: function() {

View File

@ -1,12 +1,17 @@
var React = require('react-native'); var React = require('react');
var {
Component,
PropTypes
} = React;
var ReactNative = require('react-native');
var { var {
AppRegistry, AppRegistry,
StyleSheet, StyleSheet,
Text, Text,
View, View,
Image, Image,
Component, } = ReactNative;
} = React;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {

View File

@ -1,9 +1,11 @@
const React = require('react-native'); const React = require('react');
const { const {
requireNativeComponent, Component,
Component PropTypes
} = React; } = React;
const { requireNativeComponent } = require('react-native');
class BlurView extends Component { class BlurView extends Component {
render() { render() {
return ( return (
@ -19,7 +21,7 @@ class BlurView extends Component {
} }
BlurView.propTypes = { BlurView.propTypes = {
blurType: React.PropTypes.string, blurType: PropTypes.string,
}; };
const NativeBlurView = requireNativeComponent('BlurView', BlurView); const NativeBlurView = requireNativeComponent('BlurView', BlurView);

View File

@ -1,9 +1,11 @@
const React = require('react-native'); const React = require('react');
const { const {
requireNativeComponent, Component,
Component PropTypes
} = React; } = React;
const { requireNativeComponent } = require('react-native');
class VibrancyView extends Component { class VibrancyView extends Component {
render() { render() {
return ( return (
@ -19,7 +21,7 @@ class VibrancyView extends Component {
} }
VibrancyView.propTypes = { VibrancyView.propTypes = {
blurType: React.PropTypes.string, blurType: PropTypes.string,
}; };
const NativeVibrancyView = requireNativeComponent('VibrancyView', VibrancyView); const NativeVibrancyView = requireNativeComponent('VibrancyView', VibrancyView);