-
React is javascript library used to make user interface.
-
Created at facebook and became open-source in 2013
- ctrl+shift+J is used to open react developer tool
- https://reactjs.org/
- npx - package runner
- create-react-app - tool to build our project
- These are used to insert dynamic javascript in react component with HTML.
- you can use jsx within the curly braces
- class based component
- function based component
- We don't wanna NavBar inside the app compoenent
- App.js will lay the structure for our application.
- Break the website into different component.
-
- Header component 2. Todos component 3. Todo Component
- Pass props in the parameter.
- What is Props? props is javascript object, that we pass from parent component to child component.
- In this example we are passing title from parent component from parent to child component using props.
- These are used to make code robust.
- Used to debug easily.
Header.propTypes = {
title : PropTypes.string
}
- When user forget to mention default props, then default props override the value.
Header.defaultProps = {
title : "You're title is here"
}