Uncategorized
What is Redux in React js?
Redux is a library we can use it into for state management for big applications. It’s for managing data into store management. there 3 types activities in redux.
- Store
- actions
- Reducers
Basic Redux Concept
// actions.js
export const increment = () => ({ type: 'INCREMENT' });
export const decrement = () => ({ type: 'DECREMENT' });
// reducers.js
const counterReducer = (state = 0, action) => {
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
return state - 1;
default:
return state;
}
};
export default