How to use reactnative - 10 common examples

To help you get started, we’ve selected a few reactnative examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lieryang / EYDouYin / EYDouYin / node_modules / react-native / Libraries / Components / TextInput / TextInput.js View on Github external
componentDidMount: function() {
    this._lastNativeText = this.props.value;
    const tag = ReactNative.findNodeHandle(this._inputRef);
    if (tag != null) {
      // tag is null only in unit tests
      TextInputState.registerInput(tag);
    }

    if (this.props.autoFocus) {
      this._rafId = requestAnimationFrame(this.focus);
    }
  },
github microsoft / react-native-windows / vnext / src / Libraries / Components / WebView / WebView.windows.js View on Github external
getWebViewHandle: function() {
    // eslint-disable-next-line react/no-string-refs
    return ReactNative.findNodeHandle(this.refs[RCT_WEBVIEW_REF]);
  },
github ifsnow / react-native-infinite-flatlist-patch / patches / 0.54.4 / VirtualizedList.js View on Github external
_measureLayoutRelativeToContainingList(): void {
    UIManager.measureLayout(
      ReactNative.findNodeHandle(this),
      ReactNative.findNodeHandle(
        this.context.virtualizedList.getOutermostParentListRef(),
      ),
      error => {
        console.warn(
          "VirtualizedList: Encountered an error while measuring a list's" +
            ' offset from its containing VirtualizedList.',
        );
      },
      (x, y, width, height) => {
        this._offsetFromParentVirtualizedList = this._selectOffset({x, y});
        this._scrollMetrics.contentLength = this._selectLength({width, height});

        const scrollMetrics = this._convertParentScrollMetrics(
          this.context.virtualizedList.getScrollMetrics(),
        );
github facebook / react-360 / Libraries / VRReactOverrides / AnimatedImplementation.vr.js View on Github external
__disconnectAnimatedView(): void {
    invariant(this.__isNative, 'Expected node to be marked as "native"');
    var nativeViewTag: ?number = ReactNative.findNodeHandle(this._animatedView);
    invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');
    NativeAnimatedAPI.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag);
  }
github tdzl2003 / react-native-web-platform / src / Libraries / ReactOverrides / AnimatedImplementation.web.js View on Github external
__disconnectAnimatedView(): void {
    invariant(this.__isNative, 'Expected node to be marked as "native"');
    var nativeViewTag: ?number = findNodeHandle(this._animatedView);
    invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');
    NativeAnimatedAPI.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag);
  }
github facebook / react-360 / Libraries / VRReactOverrides / AnimatedImplementation.vr.js View on Github external
__connectAnimatedView(): void {
    invariant(this.__isNative, 'Expected node to be marked as "native"');
    var nativeViewTag: ?number = ReactNative.findNodeHandle(this._animatedView);
    invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');
    NativeAnimatedAPI.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag);
  }
github tdzl2003 / react-native-web-platform / src / Libraries / ReactOverrides / AnimatedImplementation.web.js View on Github external
__connectAnimatedView(): void {
    invariant(this.__isNative, 'Expected node to be marked as "native"');
    var nativeViewTag: ?number = findNodeHandle(this._animatedView);
    invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');
    NativeAnimatedAPI.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag);
  }
github panda912 / RNAndroidPullToRefresh / src / component / PtrComponent.js View on Github external
autoRefresh() {
        let self = this;
        UIManager.dispatchViewManagerCommand(
            ReactNative.findNodeHandle(self.refs[REF_PTR]),
            1,
            null
        );
    }
github iceskyblue / RN-RecyclerView / ReactNative / index.android.js View on Github external
componentDidMount(){
        //构造数据
       for(ii=0; ii<100; ii++){
           if(ii%2 === 0){
               //使用0类型的view
               dataSet.push({'viewType':0, 'img':'http://facebook.github.io/react/img/logo_og.png', 'data':'row'+ii});
           }else{
               //使用1类型的view, 其中data对应的TextView还支持html标签哦。
               dataSet.push({'viewType':1, 'img':'http://facebook.github.io/react/img/logo_og.png', 'data':"<font color="#ff0000" size="16">row"+ii+"</font>"});
           }
           
       }
       //设置数据给RecyclerView, 命令2表示设置数据
       NativeModules.UIManager.dispatchViewManagerCommand( ReactNative.findNodeHandle(this.refs.recycle), 2, dataSet);
       //同时滚动到第5行, 命令1表示滚动到某一行
       NativeModules.UIManager.dispatchViewManagerCommand( ReactNative.findNodeHandle(this.refs.recycle), 1, [5]);
    }
github facebook / react-360 / Libraries / Sound / Sound.js View on Github external
_play() {
    UIManager.dispatchViewManagerCommand(
      ReactNative.findNodeHandle(this),
      UIManager.Sound.Commands.play,
      []
    );
  },

reactnative

Unknown
Latest version published 10 years ago

Package Health Score

34 / 100
Full package analysis

Popular reactnative functions