reading-note

https://eng-ehabsaleh.github.io/reading-note/

View on GitHub

life cycle Method

note : life cycle method only used within class component

Cases of cycle method

we will describe the methids in the order of excution

What types of things can you pass in the props?

Props (aka “properties”) in React allows us to pass values from a parent component down to a child component. The values can be any data type, from strings to functions, objects, etc. Components cannot change their props - this can only be done externally, as the parent component changes the values passed down

What is the big difference between props and state?

‪What is the big difference between props and state? in react js ‬‏ Basically, the difference is that state is something like attributes in OOP : it’s something local to a class (component), used to better describe it. Props are like parameters - they are passed to a component from the caller of a component (the parent) : as if you called a function with certain parameters

When do we re-render our application?

React components automatically re-render whenever there is a change in their state or props. A simple update of the state, from anywhere in the code, causes all the User Interface (UI) elements to be re-rendered automatically.

What are some examples of things that we could store in state?

Anything you can do in JavaScript, you can also do in React.