Skip to content

Commit

Permalink
make it compatible with react-native 0.45
Browse files Browse the repository at this point in the history
  • Loading branch information
comigor committed Jun 26, 2017
1 parent 2e5ea29 commit ce1ee74
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 17 deletions.
9 changes: 9 additions & 0 deletions createReactNativeComponentClass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var createReactNativeComponentClass = null;

try {
createReactNativeComponentClass = require('react-native/Libraries/Renderer/shims/createReactNativeComponentClass');
} catch (e) {
createReactNativeComponentClass = require('react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass');
}

module.exports = createReactNativeComponentClass;
2 changes: 1 addition & 1 deletion elements/Circle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import Shape from './Shape';
import {CircleAttributes} from '../lib/attributes';
import {pathProps, numberProp} from '../lib/props';
Expand Down
2 changes: 1 addition & 1 deletion elements/ClipPath.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {ClipPathAttributes} from '../lib/attributes';

export default class extends Component{
Expand Down
2 changes: 1 addition & 1 deletion elements/Defs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';

export default class extends Component {
static displayName = 'Defs';
Expand Down
2 changes: 1 addition & 1 deletion elements/Ellipse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import Shape from './Shape';
import {pathProps, numberProp} from '../lib/props';
import {EllipseAttributes} from '../lib/attributes';
Expand Down
2 changes: 1 addition & 1 deletion elements/G.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import Shape from './Shape';
import {pathProps} from '../lib/props';
import {GroupAttributes} from '../lib/attributes';
Expand Down
2 changes: 1 addition & 1 deletion elements/Image.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Image } from 'react-native';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {ImageAttributes} from '../lib/attributes';
import {numberProp, touchableProps, responderProps} from '../lib/props';
import Shape from './Shape';
Expand Down
2 changes: 1 addition & 1 deletion elements/Line.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {LineAttributes} from '../lib/attributes';
import Shape from './Shape';
import {pathProps, numberProp} from '../lib/props';
Expand Down
2 changes: 1 addition & 1 deletion elements/LinearGradient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {numberProp} from '../lib/props';
import extractGradient from '../lib/extract/extractGradient';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {LinearGradientAttributes} from '../lib/attributes';

export default class extends Component{
Expand Down
2 changes: 1 addition & 1 deletion elements/Path.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {PathAttributes} from '../lib/attributes';
import Shape from './Shape';
import {pathProps} from '../lib/props';
Expand Down
2 changes: 1 addition & 1 deletion elements/RadialGradient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {numberProp} from '../lib/props';
import extractGradient from '../lib/extract/extractGradient';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {RadialGradientAttributes} from '../lib/attributes';

export default class extends Component{
Expand Down
2 changes: 1 addition & 1 deletion elements/Rect.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import './Path'; // must import Path first, don`t know why. without this will throw an `Super expression must either be null or a function, not undefined`
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {pathProps, numberProp} from '../lib/props';
import {RectAttributes} from '../lib/attributes';
import extractProps from '../lib/extract/extractProps';
Expand Down
2 changes: 1 addition & 1 deletion elements/Symbol.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import extractViewBox from '../lib/extract/extractViewBox';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {SymbolAttributes} from '../lib/attributes';

export default class extends Component{
Expand Down
2 changes: 1 addition & 1 deletion elements/TSpan.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import extractText from '../lib/extract/extractText';
import {numberProp, pathProps, fontProps} from '../lib/props';
import {TSpanAttibutes} from '../lib/attributes';
Expand Down
2 changes: 1 addition & 1 deletion elements/Text.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import extractText from '../lib/extract/extractText';
import {numberProp, pathProps, fontProps} from '../lib/props';
import {TextAttributes} from '../lib/attributes';
Expand Down
2 changes: 1 addition & 1 deletion elements/TextPath.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import {TextPathAttributes} from '../lib/attributes';
import extractText from '../lib/extract/extractText';
import Shape from './Shape';
Expand Down
2 changes: 1 addition & 1 deletion elements/Use.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../createReactNativeComponentClass';
import extractProps from '../lib/extract/extractProps';
import {pathProps, numberProp} from '../lib/props';
import {UseAttributes} from '../lib/attributes';
Expand Down
2 changes: 1 addition & 1 deletion lib/extract/extractViewBox.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import React, {Component} from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import createReactNativeComponentClass from '../../createReactNativeComponentClass';
import {ViewBoxAttributes} from '../attributes';

const meetOrSliceTypes = {
Expand Down

0 comments on commit ce1ee74

Please sign in to comment.