Skip to content

Commit

Permalink
Merge pull request #76 from ground5hark/master
Browse files Browse the repository at this point in the history
Remove createJSModules
  • Loading branch information
maxs15 authored Aug 2, 2017
2 parents 6d1c08e + d38bb10 commit 5ad3ae6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
return Collections.emptyList();
}

@Override

This comment has been minimized.

Copy link
@prtkkmrsngh

prtkkmrsngh Aug 5, 2017

@maxs15 @ground5hark This will have issue with backward compatibility. Why not just remove @Override to have support for RN 0.46.x as well as 0.47.0.

This comment has been minimized.

Copy link
@maxs15

maxs15 Aug 5, 2017

Author Owner

You're right, we do have a backward compatibility issue.
Did you find any component where they handled this issue ?
Maybe it's too early and we should have keep createJSModules for some time if it compiles anyway on 0.47.

This comment has been minimized.

Copy link
@prtkkmrsngh

prtkkmrsngh Aug 5, 2017

Yes you can go through following packages react-native-vector-icons and react-native-device-info, then are maintaining backward compatibility.

This comment has been minimized.

Copy link
@maxs15

maxs15 Aug 5, 2017

Author Owner

Ok awesome, thanks for pointing out the issue @prtkkmrsngh 👍
I'll commit the fix

This comment has been minimized.

Copy link
@prtkkmrsngh

prtkkmrsngh Aug 5, 2017

Cool!

public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
List<ViewManager> list = new ArrayList<>();
Expand Down
25 changes: 13 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {PropTypes} from 'react'
import React from 'react'
import ReactNative from 'react-native'
import PropTypes from 'prop-types';

var {
NativeModules,
Expand All @@ -13,7 +14,7 @@ var RNSpinkit = null;
class Spinkit extends React.Component {

static propTypes = {
type: React.PropTypes.string,
type: PropTypes.string,
/**
* @prop color
* @NOTE This is typically passed as a string, but technically can also be
Expand All @@ -22,16 +23,16 @@ class Spinkit extends React.Component {
* React Native will throw if passing a string into this component but a
* different type (number) down to the native module.
*/
color: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]),
size: React.PropTypes.number,
isVisible: React.PropTypes.bool,
testID:React.PropTypes.string,
accessibilityComponentType:PropTypes.string,
accessibilityLabel:PropTypes.string,
accessibilityLiveRegion:PropTypes.string,
renderToHardwareTextureAndroid:PropTypes.bool,
importantForAccessibility:PropTypes.string,
onLayout:PropTypes.func,
color: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
size: PropTypes.number,
isVisible: PropTypes.bool,
testID: PropTypes.string,
accessibilityComponentType: PropTypes.string,
accessibilityLabel: PropTypes.string,
accessibilityLiveRegion: PropTypes.string,
renderToHardwareTextureAndroid: PropTypes.bool,
importantForAccessibility: PropTypes.string,
onLayout: PropTypes.func,
};

static defaultProps = {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
}
},
"dependencies": {
"prop-types": "^15.5.8"
}
}

0 comments on commit 5ad3ae6

Please sign in to comment.