- In their most basic form, React components (views) are a function that takes data and outputs DOM elements: – – Here’s an example of the render function of a React component: – – What happens if the data changes?
- We can now use a simple reference comparison to detect whether our data has changed: – – The list of todos has also changed: – – But, the first todo hasn’t changed, it’s still the same object!
- If you’re using Immutable.js, a reference comparison in is enough to determine if a component’s data has changed.
Continue reading “React and Immutable.js”
- To create a nested route (like /home/homey ), simply nest the component inside of the component within and your route will be created .
- Container gives you the container component with all the application state.
- The function call returns the current state object.
- Desklamp allows you to keep your state in a single state object.
- // Child components become your routable urls
clean routing and state container for react
Continue reading “desklamp”
- The list will only be updated if the list changes, not on every re-render triggered by the parent component.
- The new value is used to update the state of the input component’s parent component.
- As the parent component, Color is responsible for maintaining the state and triggering the re-rendering of its child components.
- The child component is not responsible for updating anything with the new data, it simply passes that data along to its parent component which performs the update.
An earlier article explored data within a React component. Data is represented by two structures–properties and state. The former is used to represent immutable data,
Continue reading “Getting Started ReactJS State Propagation”