670 likes | 1.02k Views
This Simplilearn presentation on React Redux Tutorial will help you in understanding the fundamentals of Redux and help you in implementing Redux with React. Redux is an essential library that helps in state management throughout a React Web Application. This presentation includes the following topics:<br><br>Why Redux? <br>What is Redux? <br>Principles of Redux <br>Pillars of Redux <br>Pros and Cons of Redux <br>React Redux Basic Application <br><br>About Simplilearn ReactJS training course:<br>Puzzled about React.js and how it differs from other JavaScript frameworks? Simplilearnu2019s online training course on React.js will give you a firm base on how React enables developers to master user interface developing skills with ease. This course will enable you to build React.js applications using React router, data flow and usage with react, bootstrap and CSS, and React middleware.<br><br>What is the focus of this course?<br>Simplilearnu2019s React.js course is specifically framed for web developers to enhance their web developing skills. Learn how React is different than other JavaScript frameworks, because it is not really a framework. React is actually mainly a view layer, which is beneficial for use in teams and promotes well-organized code. The main focus of this course then involves aiding you to build simple components and integrating them into more complex design components. Gradually, you will be able to implement components, manage data, handle events, apply routing and much more. Componentized UI is the future of web development, and learning React.js now will ensure your skills remain relevant in this fast-changing industry.<br><br>What are the course objectives?<br>After completing this course, you will get a head start to work with React.js productively and gain the following:<br>- Acquire hands-on knowledge on basic React components and apply them<br>- Code a React with online Integrated Development Environment (IDE) like an expert<br>- Manage data by using State and Props of React<br>- Learn how to handle events<br>- Execute Reactu2019s robust router<br>- Use flux to augment features of a React app<br>- Implement Bootstrap and CSS to style a React app<br>- Understand about React and how it fits into your web developing process<br><br>ud83dudc49Learn more at: https://bit.ly/3eDUOwb
E N D
What’s in it for you? Comparison between ReactJS, Angular and Vue with respect to - Why Redux? What is Redux? Principles of Redux Pillars of Redux Pros and Cons of Redux Demo
Why Redux? Let’s learn about state objects and see why Redux was introduced
Why Redux? A state is an object that stores the values of properties belonging to a component that could change over a period of time A state can be modified based on user action or network changes Every time the state of an object changes, React re-renders the component to the browser The state object can store multiple properties
Why Redux? Consider a humungous React application that consists of several components with a massive number of state objects
Why Redux? Every time the user switches to a different application and returns to the current app, they will find the app in the same “state”
Why Redux? This is because the state of the application while switching, was stored and then was re-rendered when switched back. Hence these state objects need to be managed and Redux does just the same
Why Redux? This is because the state of the application while switching, was stored and then was re-rendered when switched back. Hence these state objects need to be managed, and Redux does just the same
What is Redux? Redux is a predictable state container for JavaScript applications. It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test
What is Redux? Redux is a predictable state container for JavaScript applications. It helps you write apps that behave consistently, run in different environments (client, server, and native), and are easy to test
What is Redux? Redux is a predictable state container for JavaScript applications. It helps you write apps that behave consistently, run in different environments (client, server, and native), and are easy to test Redux is a state management tool
What is Redux? Redux is a predictable state container for JavaScript applications. It helps you write apps that behave consistently, run in different environments (client, server, and native), and are easy to test Redux is a state management tool Redux can be used with any JavaScript framework or library
What is Redux? Redux is a predictable state container for JavaScript applications. It helps you write apps that behave consistently, run in different environments (client, server, and native), and are easy to test Redux is a state management tool Redux can be used with any JavaScript framework or library Redux stores the state of the application, and the components can any access the state from a state store
What is Redux? In simple words..
What is Redux? In simple words.. Redux stores all the state objects in a single store and organizes it
What is Redux? In simple words.. It provides information about the current state of the application
What is Redux? In simple words.. Any changes in the state of the application can be described to this store by the user
What is Redux? In simple words.. It notifies any modifications made to the state of the application
Principles of Redux 1 Single source of truth
Principles of Redux 1 Single source of truth The state of your whole application is stored in an object tree within a single-store
Principles of Redux 1 Single source of truth The state of your whole application is stored in an object tree within a single-store A single state tree also makes it easier to debug or inspect an application
Principles of Redux 1 Single source of truth The state of your whole application is stored in an object tree within a single-store A single state tree also makes it easier to debug or inspect an application It also enables you to persist your app's state in development, for a faster development cycle
Principles of Redux 2 State is read-only
Principles of Redux 2 State is read-only The only way to change the state is to emit an action, an object describing what happened
Principles of Redux 2 State is read-only The only way to change the state is to emit an action, an object describing what happened This feature ensures that no events like network callbacks or views change the state. They can only express an intent to change the state
Principles of Redux 2 State is read-only The only way to change the state is to emit an action, an object describing what happened This feature ensures that no events like network callbacks or views change the state. They can only express an intent to change the state Actions are just plain objects; they can be logged, serialized, stored, and later replayed for debugging or testing purposes
Principles of Redux 3 Changes are made with pure functions
Principles of Redux 3 Changes are made with pure functions To specify how actions transform the state tree, you write pure reducers
Principles of Redux 3 Changes are made with pure functions To specify how actions transform the state tree, you write pure reducers A reducer is a function that accepts an accumulation and a value and returns a new accumulation. They are used to reduce a collection of values down to a single value
Principles of Redux 3 Changes are made with pure functions To specify how actions transform the state tree, you write pure reducers The user can return new state objects, instead of mutating the previous state
Principles of Redux 3 Changes are made with pure functions To specify how actions transform the state tree, you write pure reducers The user can return new state objects, instead of mutating the previous state The user can start with a single reducer, and as the app grows, one can split it off into smaller reducers that manage specific parts of the state tree
Principles of Redux 3 Changes are made with pure functions To specify how actions transform the state tree, you write pure reducers The user can return new state objects, instead of mutating the previous state The user can start with a single reducer, and as the app grows, one can split it off into smaller reducers that manage specific parts of the state tree Because reducers are just functions, controlling the order in which they are called, pass additional data, or even making reusable reducers becomes easy
Pillars of Redux Store A store is an object that holds the application's state tree. There should only be a single store in a Redux app, as the composition happens on the reducer level getState dispatch subscribe unsubscribe Action Reducers
Pillars of Redux Store A store is an object that holds the application's state tree. There should only be a single store in a Redux app, as the composition happens on the reducer level getState dispatch subscribe unsubscribe getState() returns the current state of the store Action Reducers
Pillars of Redux Store A store is an object that holds the application's state tree. There should only be a single store in a Redux app, as the composition happens on the reducer level getState dispatch subscribe unsubscribe getState() returns the current state of the store console.log("store.getState()"); Action Reducers
Pillars of Redux Store A store is an object that holds the application's state tree. There should only be a single store in a Redux app, as the composition happens on the reducer level getState dispatch subscribe unsubscribe getState() returns the current state of the store dispatch() This dispatches an action. It is the only way to update the application state Action Reducers
Pillars of Redux Store A store is an object that holds the application's state tree. There should only be a single store in a Redux app, as the composition happens on the reducer level getState dispatch subscribe unsubscribe getState() returns the current state of the store dispatch() This dispatches an action. It is the only way to update the application state Action Buttonchange: () =>dispatch({msg:"Message_change"}) Reducers
Pillars of Redux Store A store is an object that holds the application’s state tree. There should only be a single store in a Redux app, as the composition happens on the reducer level getState dispatch subscribe unsubscribe getState() returns the current state of the store dispatch() This dispatches an action. It is the only way to update the application state subscribe() This method subscribes a change listener to the state unsubscribe() It’s useful when you no longer want to call your listener method when the state changes Action Reducers
Pillars of Redux Store A store is an object that holds the application's state tree. There should only be a single store in a Redux app, as the composition happens on the reducer level getState dispatch subscribe unsubscribe getState() returns the current state of the store dispatch() This dispatches an action. It is the only way to update the application state subscribe() This method subscribes a change listener to the state unsubscribe() It’s useful when you no longer want to call your listener method when the state changes Action Reducers constunsubscribe = store.subscribe(handleChange) unsubscribe()
Pillars of Redux Store An action is a plain object that represents an intention to change the state getState dispatch subscribe unsubscribe Action Reducers
Pillars of Redux Store An action is a plain object that represents an intention to change the state getState dispatch subscribe unsubscribe Actions are payloads of information that send data from your application to your store Action Reducers
Pillars of Redux Store An action is a plain object that represents an intention to change the state getState dispatch subscribe unsubscribe Actions are payloads of information that send data from your application to your store Any data, whether from UI events or network callbacks, needs to be dispatched as actions eventually Action Reducers
Pillars of Redux Store An action is a plain object that represents an intention to change the state getState dispatch subscribe unsubscribe Actions are payloads of information that send data from your application to your store Any data, whether from UI events or network callbacks, needs to be dispatched as actions eventually Action Actions must have a type field that indicates the type of action being performed Reducers
Pillars of Redux Store Reducers specify how the application's state changes in response to actions sent to the store getState dispatch subscribe unsubscribe Action Reducers
Pillars of Redux Store Reducers specify how the application's state changes in response to actions sent to the store getState dispatch subscribe unsubscribe Actions only describe what happened, but don't describe how the application's state changes Action Reducers