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

Can not get RBSheet value when pass to another component #39

Closed
jasminecrazy opened this issue Nov 20, 2019 · 0 comments
Closed

Can not get RBSheet value when pass to another component #39

jasminecrazy opened this issue Nov 20, 2019 · 0 comments

Comments

@jasminecrazy
Copy link

Hi,
Currently I tried to add raw-bottom-sheet in my project and see that sometime the rbsheet didn't have value. Could you please let me know why?

 <RBSheet
          ref={ref => {
            this.RBSheet = ref;
          }}
          height={159}
          duration={250}
          customStyles={{
            container: {
              backgroundColor: '#ebebeb',
              alignItems: "center",
              borderRadius: 13
            }
          }}
        >
          <TouchableOpacity
                onPress={() => this.RBSheet.close()}
              >
              <OthersLoginWay rgbSheet={this.RBSheet} />
          </TouchableOpacity>
        </RBSheet>

In OthersLoginWay component:

componentDidMount = async () => {
      console.log(1, this.props.rgbSheet); // sometime it undefined
        await this.setState({rgbSheet: this.props.rgbSheet});
    }

    _otherlogin() {
        this.state.rgbSheet.close();
        
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant