Tom
0
Q:

Redux

Dont go to reddit?! Keep coding!
Unless the subreddit is coding related :D
99
Copynpx create-react-app my-app --template redux
2
npm install redux // adding redux to the project
// creating types 
export const SET_USER = 'SET_USER'
//creating actions 
export const setUser = user => {
  return {
    type : SET_USER,
    payload : {
      currentUser : user
    }
  }
// creating reducers 
  const user_reducer = (state=intialState,action)=>{
    switch(action.type){
      case SET_USER :
        return {
          currentUser : action.payload.currentUser
        }
    }
0
npx create-react-app my-app --template redux
0

New to Communities?

Join the community