score:0
Accepted answer
You can do it in componentDidUpdate
:
componentDidUpdate(prevProps) {
const {user} = this.props.auth;
if (user && user._id && user._id !== prevProps.auth.user._id) {
this.props.getMyLessons(user._id);
}
}
Source: stackoverflow.com
Related Query
- Where should I put my dispatch in lifecycle react redux
- Where should I put images files in React project?
- Where does the root reducer come from in this redux react example and how does dispatch knows which reducer to go?
- Where should I call subscriptions in React Redux Meteor.js mixture
- where should I dispatch my redux
- Where should I put my logic for initializing state in a Redux application
- React StrictMode double initializasion - where to put logic that should be executed only once
- Redux: where should we put initialize state for react app
- When should I add Redux to a React app?
- Where do I fetch initial data from server in a React Redux app?
- Where should I handle sorting in Redux App?
- Where do I put coding logic in my React Application
- Where do long-running processes live in a React + Redux application?
- React Redux dispatch action after another action
- What are the cases where Redux dispatch could change?
- Where to store WebRTC streams when building React app with redux
- Where to put enums in my react application
- Where to put all the screens which are common in multiple stack navigators? - React Navigation v5
- react context vs redux vs hooks, which one should consider and how each one is different
- Is it possible to put a callback to useReducer's dispatch in React Hooks?
- React Redux error: default parameters should be last default-param-last
- how should I build onClick action in my react component + Redux
- React Router + Redux - Dispatch an async action on route change?
- React Redux - How to dispatch an action on componentDidMount when using mapDispatchToProps in a connected component
- Should i fetch data in react component or redux action?
- React redux dispatch action before render container
- React + Redux + Router - should I use one state/store for all pages/components?
- Should I be concerned with the rate of state change in my React Redux app?
- When should I use Redux in my react application?
- Where should you put the git hub workflow directory for actions in a full-stack project?
More Query from same tag
- React d3 - How to: Several ares on one line chart
- Tags AutoComplete with Ajax on React
- Add new property to state object from a form component with redux
- With Material-UI's DataGrid component, how do I create multi layered text in one of the cells?
- Creating Custom Components and Nesting them
- Building a 24h visualisation with chartjs
- How to send variable along with Redirect in Reactjs?
- What does #describe and #it methods do in TDD react testing?
- spring boot and reactjs for frontend was working fine till i add security to the backend
- How come my state isn't being filled with response?
- react-router-dom@4.0.0 requires a peer of react@^15 but none is installed. You must install peer dependencies yourself
- Material-UI Checkbox is not reset while using react-hook-form reset function
- How to render appropriate dropdown options in redux-forms/final-forms?
- How to instantiate react component with injected properties
- wait for array to be filled using .push in react?
- How do I make a common function work for a clicked event only in react?
- why does my react-big-calendar looks like this?
- OneOf Arrays in FireCMS - Firebase
- Mock window.performance.getEntriesByType
- ReactJS - Custom hook to create a single object with the data collected from multiple form components
- Is it possible to use values of promises in a functional React component?
- React refs on multiple elements through map
- Sorting dates throws exception TypeError: data.createdAt.sort is not a function
- React Routing Redirect onClick
- How to change the background color of the div while focusing the text Input field?
- Property does not exist on state - Using React Router Hooks with TypeScript
- Axios.post then method doesn't run
- How to change className based on state and re render it in a functional component
- React-Bootstrap DropDown Button pullRight/Left
- How to override Amplify theming with Material UI