How to use react-native-root-siblings - 10 common examples

To help you get started, we’ve selected a few react-native-root-siblings 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 NervJS / taro / packages / taro-rn / src / api / interface / toast.js View on Github external
ToastView = <View style={styles.container}>
      <View style={styles.grayBlock}>
        <View style={styles.toastView}>
          <Image source={successPng} style={styles.toastIcon} />
          <Text style={styles.toastContent}>{title || ''}</Text>
        </View>
      </View>
    </View>
  }

  try {
    // setTimeout fires incorrectly when using chrome debug #4470
    // https://github.com/facebook/react-native/issues/4470
    global.wxToastRootSiblings && global.wxToastRootSiblings.destroy()

    global.wxToastRootSiblings = new RootSiblings(ToastView)
    setTimeout(() => {
      global.wxToastRootSiblings && global.wxToastRootSiblings.update(ToastView)
      success && success()
    }, 100)
    if (duration > 0) {
      setTimeout(() => {
        console.log('destroy')
        global.wxToastRootSiblings && global.wxToastRootSiblings.destroy()
      }, duration)
    }
    return successHandler(success, complete)(res)
  } catch (e) {
    res.errMsg = `showToast:fail invalid ${e}`
    return errorHandler(fail, complete)(res)
  }
}
github jacklam718 / react-native-modals / src / Modal.js View on Github external
createModal() {
    // Protect against setState happening asynchronously
    if (!this.sibling) {
      this.sibling = new Sibling(this.renderModal());
    }
  }
github 15826954460 / BXStage / app / components / CNotice.js View on Github external
static showSiblings = (params) => {
    SiblingsNotice.siblingInstance = new RootSiblings(<CNotice params={params}/>)
  };
github jacklam718 / react-native-action-sheet-component / src / ActionSheetManager.js View on Github external
setCurrent(props: Object, callback?: Function = () => {}): void {
    if (!props) {
      return;
    }

    this.currentActionSheet = new RootSiblings(
      <ActionSheet {...props} />,
      callback,
    );
  }
github N3TC4T / Nearby-Live / src / components / ui / alerts / Alert.js View on Github external
componentWillMount() {
        this._alert = new RootSiblings(<AlertContainer
            {...this.props}
            duration={0}
        />);
    }
github gaoxiaosong / react-native-general-actionsheet / index.js View on Github external
showActionSheetWithOptions: (config, callback) => {
        if (Platform.OS === 'ios' && ActionSheet.useActionSheetIOS) {
            ActionSheetIOS.showActionSheetWithOptions(config, callback);
            return;
        }
        if (instance) {
            return;
        }
        instance = new RootSiblings(
            <ActionSheet.Container
                config={config}
                callback={(index) => {
                    instance && instance.destroy(() => {
                        instance = null;
                        setTimeout(() => {
                            callback && callback(index);
                        }, 0);
                    });
                }}
            />
        );
    },
};
github amandakelake / ReactNativeNavigationDemo / src / screen / home / index.js View on Github external
import React, { Component } from 'react';
import { Text, View, StyleSheet, TouchableOpacity } from 'react-native';
import RootSiblings from 'react-native-root-siblings';

import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as homeActions from '../../action/home';

let sibling = new RootSiblings(
  (
    <View
      style={{ top: 0, right: 0, bottom: 0, left: 0, backgroundColor: 'red' }}
    />
  )
);

type Props = {};

class Home extends Component<Props> {
  constructor(props) {
    super(props);
    this.state = {
      a: 1
    };
    this.optimize = this.optimize.bind(this);
github liuzheng644607 / react-native-intro / src / IntroManage.js View on Github external
start = () => {
    if (!this.sibling) {
      this.sibling = new RootSiblings(
        (
          <IntroModal
            ref={c => (this.refModal = c)}
            next={this.next}
            prev={this.prev}
            stop={this.stop}
            contentRender={this.opts.contentRender}
            showStepNumber={this.opts.showStepNumber}
            maskStyle={this.opts.maskStyle}
            touchable={this.opts.touchable}
            maskClosable={this.opts.maskClosable}
          />
        )
      );
    }
    this.cleartTimers();
github airloy / objective / src / widgets / ActivityIndicator.js View on Github external
static show(type='Circle') {
    indicator || (
      indicator = new RootSiblings(
        <View style={style.container}>
          <Spinner isVisible={true} size={100} type={type} color={colors.accent}/>
        </View>
      )
    );
  }

react-native-root-siblings

react native root sibling elements manager

MIT
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis