LucasBassetti / react-native-chatbot

:speech_balloon: Easy way to create conversation chats
https://github.com/LucasBassetti/react-simple-chatbot
MIT License
248 stars 114 forks source link

Strange issue with component (custom message) in Release mode #29

Open iosfitness opened 6 years ago

iosfitness commented 6 years ago

Description

I am trying to display a link in the message. It works in the debug mode but when I try to test it release mode it doesn't display

Below is the code for reference

steps={[ id: 'Claims & Refund', component:<Link />, asMessage: true, trigger: 'auto-reply' ]}

class Link extends Component { constructor(props) { super(props); this.state = {

};

}

componentWillMount() { const { steps, step } = this.props; }

render() { return (

{ Please visit this link About xxx Trade } { this.props.step.id == 'Cargo Clearance' && Please visit this link Linking.openURL('http://www.xxx.ae/en/service/service-provider/dp-world/cargo-clearance.html?serviceType=External')}> Cargo Clearance
    }

    {
      this.props.step.id == 'Case Registration' && <View>
        <Text style={{ color: 'white' }}>Please visit this link</Text>
        <Text style={{
          color: 'white', textAlign: 'center',
          fontSize: 20
        }}
          onPress={() => Linking.openURL('http://www.xxx.ae/en/service/service-provider/dp-world/case-registration.html?serviceType=External')}>
          Case Registration</Text>
      </View>
    }

    {
      this.props.step.id == 'Claims & Refund' && <View>
        <Text style={{ color: 'white' }}>Please visit this link</Text>
        <Text style={{
          color: 'white', textAlign: 'center',
          fontSize: 20
        }}
          onPress={() => Linking.openURL('http://www.xxx.ae/en/service/service-provider/dp-world/claims-and-refund.html?serviceType=External')}>
          Claims and Refund</Text>
      </View>
    }

    {
      this.props.step.id == 'Clearance Ports' && <View>
        <Text style={{ color: 'white' }}>Please visit this link </Text>
        <Text style={{
          color: 'white', textAlign: 'center',
          fontSize: 20
        }}
          onPress={() => Linking.openURL('http://www.xxx.ae/en/service/service-provider/dp-world/clearance-ports.html?serviceType=External')}>
          Clearance Ports</Text>
      </View>
    }

  </View>
);

} } Link.propTypes = { steps: PropTypes.object, step: PropTypes.object, };

Link.defaultProps = { steps: undefined, step: undefined, };

screen shot 2018-05-17 at 7 18 33 pm screen shot 2018-05-17 at 7 17 21 pm

Any inputs ?