-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
35 lines (29 loc) · 988 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react';
// import { StyleSheet, Text, View } from 'react-native';
import Start from './components/Start';
import Chat from './components/Chat';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import KeyboardSpacer from 'react-native-keyboard-spacer';
// local setup fixing errors
// you must first run the code in the chatApp directory
// npm install base-64 when it shows that the variable atob() and btoa() are missing.
//https://www.npmjs.com/package/base-64
import { decode, encode } from 'base-64';
if (!global.btoa) {
global.btoa = encode;
}
if (!global.atob) {
global.atob = decode;
}
/**
* @param {{screen:Start}} {Start
* @type createStackNavigator
* @param {{screen:Chat}}} Chat
*/
const navigator = createStackNavigator({
Start: { screen: Start },
Chat: { screen: Chat }
});
const navigatorContainer = createAppContainer(navigator);
export default navigatorContainer;