prscX / react-native-app-tour

React Native: Native App Tour Library
Apache License 2.0
640 stars 119 forks source link

where is collapasable in your library. couldn't find it anywhere in your library? #42

Closed sarinupreti closed 6 years ago

sarinupreti commented 6 years ago

getting this error.

trying to resolve view with tag 130 which doesn't exist.

this is the component i created using the library

import { StyleSheet, TouchableOpacity, View } from 'react-native';
import React from 'react';
import { theme } from '../global/theme';
import { AppTourView } from 'react-native-app-tour';
import { connect } from 'react-redux';

export default connect(state => ({
  firstTime: state.checkTutorial.firstTime
}))(
  class TipView extends React.PureComponent {
    render() {
      if (!this.props.firstTime) {
        return this.props.children;
      }

      return (
        <TouchableOpacity
          collapsable={false}
          style={this.props.tipStyle || styles.container}
          key={this.props.TipViewkey}
          title={this.props.title}
          ref={ref => {
            if (!ref) return;
            let props = {
              order: this.props.order,
              title: this.props.longTitle,
              description: this.props.description,
              outerCircleColor: theme.secondaryColor,
              cancelable: false,
              transparentTarget: true,
              targetRadius: this.props.radius || 90,
              titleTextSize: 24,
              collapsable: false,
              descriptionTextSize: 20
            };
            this.props.addAppTourTarget &&
              this.props.addAppTourTarget(AppTourView.for(ref, props));
          }}
        >
          {this.props.children}
        </TouchableOpacity>
      );
    }
  }
);

const styles = StyleSheet.create({
  container: { borderRadius: 4 }
});
prscX commented 6 years ago

Thanks @sarinupreti for raising the issue.

I believe collapsable prop does not work with TouchableOpacity, you need to wrap this component in a View by specifying collapsable:false to the View.

Please let me know incase you still face the same issue.

Thanks </ Pranav >