Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing yellow warning for UIManager in ReactNative #281

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
11 changes: 6 additions & 5 deletions lib/src/InteractableView.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -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],
);
}
Expand All @@ -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],
);
}
Expand All @@ -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],
);
}
Expand All @@ -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,
[],
);
}
Expand Down