You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in index.js, create your root reducer and set up redux middleware
export your configure store function
create your store
top level index.js file, create store and wrap the provider around your app
create a reducer for auth
create constants
create action-creators
create thunks (replace each of the functions in the "services" folder with a thunk version)
replace all my state based logic for auth with the use of my redux store
anytime i use a value from a useState, i will want to use useSelector
anytime i use the function to change the state, i will want to use a dispatch
// if i am refactoring some piece of state to use redux...const[myState,setMyState]=useState(null);// any time i see that i'm using the "myState" value, i want to use a selector instead to get the value from my redux storeconstmyState=useSelector(state=>state.stateSlice.myState)// any time i see that i'm using "setMyState" to change the value of myState// I will need to dispatch a redux thunk or action creator insteaddispatch(updateMyState(newState));// anytime i see that i am ONLY using the value to pass it as a prop// i should just remove it from that component all together