dailylog 07-24-21
Section 15: In-App Authentication
- Unzip files
npm install
- cloud.mongodb.com
- create free cluster
- Update mongoURI in src/index file
npm run dev
- control c shuts down
npx expo-cli init urn-tracks --npm
NOTES FROM A PAST LIFE
I kept getting this infuriating error on my phone when I would scan the QR code – “The experience you requested uses Expo SDK v(null), but this copy of Expo Client…” etc.
I did A LOT of googling and tried many different things but ultimately what ended up working was
-
COMPLETELY uninstalling expo-cli
npm -g uninstall expo-cli --save && yarn global remove expo-cli
-
Removing all traces
cd ~ && rm -rf .expo
-
Starting at the top of this document and going through it all over again. This time, I also followed Step 5 exactly (and put the folder into ~/ … which makes my skin crawl) because previously I had it in my own “PROJECTS” directory. So technically I changed two things and I have no idea which one is responsible for everything magically working again…?
197. Navigation Design
Stack Navigator Bottom Tab Navigator Switch Navigator Drawer Navigator
Sign up should be using switch navigator
GET EXPO QR CODE TO WORK ON PHONE
npm install react-navigation
expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
npm install react-navigation-stack @react-native-community/masked-view
npm install react-navigation-tabs
expo r -c
199. a LOT of Boilerplate
- Make src directory in same level as node_modules
- make screens directory inside it
- Make a file for each screen (e.g. SignupScreen.js)
Delete everything from App.js
import AccountScreen from ‘./src/screensAccountScreen
200. Navigator Hookup
NOTE: Course uses react-navigation 4, switched to react-navigation 5 using this code
- Write import statements
- Create our navigation flow
- loginFlow
- mainFlow
LOGIN FLOW:
- switch navigator
- SignUp
- SignIn
MAIN FLOW:
- bottom tab navigator
- stackNavigator
- TrackList
- TrackDetail
- TrackCreate
- Account
- stackNavigator
202. React Native Elements
- in Signup
- remove Text and Button from react-native
- import Text Input Button from react-native-elements
TEXT h3 INPUT label=”Email IPUT label=”PASSWORD BUTTON self closing title=”SignUp”
- Add Spacer Helper
- Components in src
- Spacer.js
- import View, StyleSheet from react-native
const Spacer = ({ }) export default Spacer