Skip to content

Instantly share code, notes, and snippets.

@SantoshCode
Last active May 16, 2021 16:26
Show Gist options
  • Save SantoshCode/9732959594fe92226b18501880173905 to your computer and use it in GitHub Desktop.
Save SantoshCode/9732959594fe92226b18501880173905 to your computer and use it in GitHub Desktop.
How to re-render a component even on memoization like when using selectors

How to re-render a component even on memoization like when using selectors?

Afte the task has been done simply reset the state but useEffect dependency should have memoized state as dependency

e.g.

if (taskIsCompleted){
  dispatch({type: "RESET_STATE"})
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment