Discuss in words something you learned in class today or this week.
This week i learned about React Routers. React Routers is a function, that when called, returns its component its assigned to. An example is when a user is on their browser and they click on a “About” page, the user get routed to that specific page via its declared route. Really awesome and super simple.
render() in React? Explain its purpose.
— We should start by explaining that each React component must have a render() because it returns a single React element which is the representation of the native DOM component.
— Because setState is asynchronous, subsequent calls in the same update cycle will overwrite previous updates, and the previous changes will be lost.
What are controlled components?
— A controlled component is one where form data is stored in the component’s state and updated by an “onChangeHandler”. A single handler can handle all of the form’s input fields, regardless of the type (input, select, textarea, etc). In addition to the benefit of consolidating data, controlled components enable in-place feedback.
Why does ReactJS use className over class attribute?