In this guide, you'll learn how to move items between two components in React using a practical example. React allows you to share data between components through props. Your component tree can be structured such that two _sibling components_ can share the same data through a parent component’s state.
React allows you to share data between components through props. Your component tree can be structured such that two sibling components can share the same data through a parent component’s state. This idea can be extended to many use cases, such as moving data or items between two components to convey different meanings to the user.
In this guide, you'll learn how to move items between two components in React using a practical example.
A practical use case where you would need to move items between two or more components would be a task-managing web app where employers update the status of given tasks. In this example, you'll build a simple version of a task manager app and move items from one component to another using props. For brevity and simplicity, assume that each task has only two possible statuses,
Pending. On clicking a button, you can move a particular task from
Completed and vice versa.
Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.
I have been using React JS in my projects for quite some time now and am used to managing routing in my app using the react-router package. I have always been keen on having as little dependencies in my apps as possible, so, I always felt perturbed by the use of this particular package in simpler apps which did not have complex routes.
In this video I wanted to show the basics of Redux in React, I didn't go over anything complex as I wanted this to be a beginners introduction into Redux. Let me know in the comments if you would like to see more content on redux such as Redux Thunk.