Notes and practice projects about Mobile Application of Harvard University CS50 course. (Spring 2018)
Lecture | Title / Contents | Materials | Project / Exercise |
---|---|---|---|
Lecture 0 | Overview, JavaScript | slides, code | - |
Lecture 1 | JavaScript, ES6 | slides, code | Project 0 - TODO App |
Lecture 2 | React, Props, State | slides, code | - |
Lecture 3 | React Native | slides, code | Project 1 - Pomodoro Timer |
Lecture 4 | React Native | slides, code | exercise |
TODO: demo screenshot
Notes:
-
JavaScript Property
- innerHTML:
- HTMLDOMObject.innertHTML
- The Element property innerHTML gets or sets the HTML or XML markup contained within the element.
- children:
- It will return a "HTMLCollection" and it can be accessed like an array.
- Best way to get child node -- Stackoverflow
- parentNode:
- Return its parent node element
- appendChild
- innerHTML:
-
Delete Element
- Traditional way
element.parentNode.removeChild(element)
- jQuery (DOM Library)
$('#some_element').remove()
- jQuery Remove Element
- Traditional way
-
console.log(Object) will show the object detail on browser's console. (If not familar with the object property it's a good way to find out)
Example:
My publish: https://exp.host/@daviddwlee84/pomodoro-timer
TODO: demo screenshot
# install dependencies
npm install
# install expo cli tool
npm install expo-cli --global
# start debuging
expo start
- Picker
- TouchableOpacity (replacement of Button)
- InputText
- javascript - Understanding unique keys for array children in React.js - Stack Overflow
- reactjs - React-Native Button style not work - Stack Overflow
- react native - How to prevent layout from overlapping with iOS status bar - Stack Overflow
- not sure why
Constants.statusBarHeight
still can't work even installexpo-constants
- not sure why
- Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference · Issue #2924 · react-native-community/react-native-maps
Example
- Mobile App Development with React Native - Spring 2018 (link broken)
- edx - CS50's Mobile App Development with React Native
- Youtube playlist
- CS50 Github
- Mobile50 Github - It will including your private project repository when you use Github Classroom. Just fork it to your account.
- Others' Project
Flexbox
- React Native Tutorial 8: Stylesheets and Flexbox Layouts - YouTube
- Aligning Children using Flexbox in React Native - Modus Create
For React
- CodeSandbox: Online Code Editor Tailored for Web Application Development - Test React in the sandbox
For React Native
- Expo - Suite of tools to accelerate the React Native development - Expo — Learn how | Getting Started
- Snack - Test React Native in the browser
- XDE
- Appetize.io - Run native mobile apps in your browser
- react-native-community/react-native-slider: React Native component used to select a single value from a range of values
- oblador/react-native-vector-icons: Customizable Icons for React Native with support for NavBar/TabBar/ToolbarAndroid, image source and full styling.
- yamill/react-native-orientation: Listen to device orientation changes in react-native and set preferred orientation on screen to screen basis.
- React Native
- Expo (github)
- Constants - Expo Documentation
- Upgrading Expo SDK Walkthrough - Expo Documentation
expo update 35.0.0
(2019/12)
- Building Standalone Apps - Expo Documentation
expo login
expo build:android -t apk
- Babel
- Flexbox
- Copy a file's contents to clipboard:
cat file.js | pbcopy
- Babel plugin problem
- Build fails after eject: Cannot find module '@babel/plugin-transform-react-jsx' · Issue #6099 · facebook/create-react-app
rm -rf node_modules && yarn
- babel-plugin-transform-react-jsx-source - npm
npm install --save-dev babel-plugin-transform-react-jsx-source
- App.js: Cannot read property 'filename' of undefined after update sdk to 31.0.0 · Issue #2576 · expo/expo
- Build fails after eject: Cannot find module '@babel/plugin-transform-react-jsx' · Issue #6099 · facebook/create-react-app