Sign in
Log inSign up

Why use Redux?

nightwalker's photo
nightwalker
·Oct 6, 2018

So I interviewed at multiple companies in past few months and I have struggled to answer this question despite having used Redux in a couple of applications.

Note - While using along with React.

Reasons I gave were

  1. To move data from component level state to global store when that particular data is being used in multiple places.
  2. To simplify how things happen upon user interaction. Eg : maybe make the API call in just one file and expose it as an action

Basically, To prevent prop drilling i.e. sending data and functions into deeply nested elements by sending them as props throughout the tree from app to grand-grand.... child component?

Could someone point out flaws in my reasons, add to them and maybe explain better why exactly we Redux need to integrate it?