react-native-rasa
Version:
An simple react native project intergrate with Rasa Open Source
39 lines (31 loc) • 790 B
JavaScript
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import {SafeAreaView, StatusBar} from 'react-native';
import RasaChat from './RNRasa';
import styles from './styles';
// your host
const HOST = 'http://localhost:5002';
//TODO: reset bot on destroy
//TODO: handle when bot response error
const App = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView style={styles.container}>
<RasaChat
// emptyResponseMessage="Sorry, I dont understand"
host={HOST}
onSendMessFailed={(error) => console.log(error)}
placeholder="Your input placeholder"
/>
</SafeAreaView>
</>
);
};
export default App;