start new app:npx create-react-app 'project name' start localhost: npm start
class component has a state, while functional component is stateless in react, we only use arrow functions in JS, we do not use function keyword.
- when we have parent and child component, we can use props to pass data from parent to child.
- App.js is Parent.js's parent component.
- to start props in class component, we need the following lines constructor(props){ super(props) }
- to start props in functional component, we need to pass props in parameter function myFunc(props){ DoThis }
- event handling in functional component: function keyword can be used.
- in class component: only arrow functions can be used.
- inline styling syntax
- see app.js for css styling
- see second.js for component styling with a different css style sheet