Please discuss with your teams and answer these questions in your own words.
- What is the difference between state and props in React?
- When should you use state and props in React?
- What is the difference between stateful and stateless components in React?
- How can you pass props to a component in React?
- How does react handle events, can you write an example?
team members :- Mustafa M. , Danah Osta ,Hevar Tofiq , Roza Nawzad , Omar Deeb
1- props are data that are passed into a component as parameters but the state is data that will be managed inside the part as much as local variables that declare inside a function
2-Props are used to transmit data, while the state is used to manage data. Additional data is read-only and cannot be modified by components that receive it from outside. State data can be changed by its components, but is private (not accessible from outside)
3-In React, a stateful component is a component that has a state which means data can be changed . Stateless components, on the otherhand means data can be changed .
4- pass it as parameters in the function ,for example :-
<Avatar {...props} />
5-its sumiller to HTML
Activate Lasers
Activate Lasers