3 Components
3 Components
#React Notes
Component
Components
▪ Components let you split the UI into independent, reusable pieces, and think
about each piece in isolation.
Header Compoment
Menu Component
Content
Component
Sidebar
Component
Footer Component
Header Compoment
Shared / ReUsable
Content
Menu Component
Header.js
Home.js
Menu.js
About.js
Sidebar.js Content
Contact.js
Footer.js Component
Sidebar
Component
Footer Component
▪ Example
▪ function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
▪ all lifecycle hooks are coming from the React.Component which you extend from in class
components.
▪ So if you need lifecycle hooks you should probably use a class component.
▪ componentDidMount
▪ Fired after the component mounted (Called When component will open)
▪ componentWillUnmount
▪ Fired before the component will unmount (Called before closing component )
▪ getDerivedStateFromProps
▪ Fired when the component mounts and whenever the props change. Used to update the state of a
component when its props change
▪ Events
▪ onClick
▪ onSubmit
▪ onChange
▪ Imrc ▪ cdu
▪ Import React Componet ▪ ComponentDidUpdate
▪ Slc ▪ cwum
▪ Simple Function ▪ ComponentWillUnmount
▪ Ccs
▪ Class Componet State
▪ Cccs
▪ Class Component Constructor State
▪ Rsf
▪ React Stateless Function
▪ Using the ES6 syntax with extends React.Component, which extends the
Component class
▪ React.Component
▪ The way in which you create a new component.
▪ ReactDOM.render
▪ Renders a React component to a DOM node.
▪ state
▪ The internal data store (object) of a component
▪ setState
▪ A helper method used for updating the state of a component and re-rendering the UI
▪ props
▪ The data which is passed to the child component from the parent component.
▪ propTypes
▪ Allows you to control the presence, or types of certain props passed to the child component.
▪ defaultProps
▪ Allows you to set default props for your component.
www.aptutorials.com
https://www.youtube.com/user/Akashtips
www.akashsir.com
Rating Us Now
Just Dial
https://www.justdial.com/Ahmedabad/Akash-Technolabs-Navrangpura-
Bus-Stop-Navrangpura/079PXX79-XX79-170615221520-S5C4_BZDET
Sulekha
https://www.sulekha.com/akash-technolabs-navrangpura-ahmedabad-
contact-address/ahmedabad
Connect With Me
# Social Info
Akash.padhiyar
Akashpadhiyar
Akash Padhiyar
#AkashSir Akash_padhiyar
+91 99786-21654
www.akashsir.com
www.akashtechnolabs.com #Akashpadhiyar
www.akashpadhiyar.com #aptutorials
www.aptutorials.com