diff --git a/.npmignore b/.npmignore index 29094f17..661cc889 100644 --- a/.npmignore +++ b/.npmignore @@ -87,9 +87,6 @@ fabric.properties # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore -#Cocoapods -*.podspec - ## Build generated ios/build/ ios/DerivedData/ diff --git a/lib/src/InteractableView.js b/lib/src/InteractableView.js index acad28ac..326f1066 100644 --- a/lib/src/InteractableView.js +++ b/lib/src/InteractableView.js @@ -1,10 +1,11 @@ import React, { Component } from 'react'; import ReactNative, { requireNativeComponent, Animated, NativeModules, UIManager, Platform } from 'react-native'; +const NATIVE_COMPONENT_NAME = 'InteractableView'; // this is required in order to perform imperative commands const NativeViewManager = NativeModules.InteractableViewManager; -const NativeInteractableView = requireNativeComponent('InteractableView', null); +const NativeInteractableView = requireNativeComponent(NATIVE_COMPONENT_NAME, null); class WrappedInteractableView extends Component { render() { @@ -73,7 +74,7 @@ class WrappedAnimatedInteractableView extends Component { } else if (Platform.OS === 'android') { UIManager.dispatchViewManagerCommand( ReactNative.findNodeHandle(this), - UIManager.InteractableView.Commands.setVelocity, + UIManager.getViewManagerConfig(NATIVE_COMPONENT_NAME).Commands.setVelocity, [params], ); } @@ -85,7 +86,7 @@ class WrappedAnimatedInteractableView extends Component { } else if (Platform.OS === 'android') { UIManager.dispatchViewManagerCommand( ReactNative.findNodeHandle(this), - UIManager.InteractableView.Commands.snapTo, + UIManager.getViewManagerConfig(NATIVE_COMPONENT_NAME).Commands.snapTo, [params], ); } @@ -97,7 +98,7 @@ class WrappedAnimatedInteractableView extends Component { } else if (Platform.OS === 'android') { UIManager.dispatchViewManagerCommand( ReactNative.findNodeHandle(this), - UIManager.InteractableView.Commands.changePosition, + UIManager.getViewManagerConfig(NATIVE_COMPONENT_NAME).Commands.changePosition, [params], ); } @@ -107,7 +108,7 @@ class WrappedAnimatedInteractableView extends Component { if (Platform.OS === 'android') { UIManager.dispatchViewManagerCommand( ReactNative.findNodeHandle(this), - UIManager.InteractableView.Commands.bringToFront, + UIManager.getViewManagerConfig(NATIVE_COMPONENT_NAME).Commands.bringToFront, [], ); }