Notes for Codefellows Code 401 301 201 and 102
geeksforgeeks Yes - we can access the childs state using Refs. You can assign a Refs for the child component in the parent component. then using Refs we can access the child’s state. You can also pass down a function to the child and the child calls the function with an argument from the child (data or state) and thereby float the data up to the parent.
data (integers, arrays, objects, boolean) or functions/methods
codecademy To obtain the state of another component, you can pass a component’s state to its child components as props. Also, you can have components share a common ancestor, and have them access the same state in a similar manner.
source Props is a special keyword in React, which stands for properties and is being used for passing data from one component to another.
w3schools is managed within the component (similar to variables declared within a function). If a Component needs to alter one of its attributes at some point in time, that attribute should be part of its state, otherwise it should just be a prop for that Component. React components has a built-in state object. The state object is where you store property values that belongs to the component. When the state object changes, the component re-renders.
stackoverflow state at which an application resides with regards to where in a program is being executed and the memory that is stored for the application. Application state refers to the current state of an application and is easily managed with the state management library, React. Redux is a useful tool to store global state for your application. Recently, application state management has been made even simpler with the addition of React hooks.
Skim the following materials in preparation for the upcoming lecture. Note the following as you browse the material, and be prepared to participate in discussions during lecture
Which 3 things had you heard about previously and now have better clarity on? props and state Which 3 things are you hoping to learn more about in the upcoming lecture/demo? react-if What are you most excited about trying to implement or see how it works? react if and testing