GithubHelp home page GithubHelp logo

redux-store's Introduction

redux-store

This is a React redux car application to get practice using Redux essentials

In this activity, you will refactor an application that uses the Context API so that it handles state using the open source JavaScript library Redux.

Setup

Copy the src directory from the Develop folder into 00-practice-app before you begin.

Instructions

  • Begin by installing the redux and react-redux libraries with npm.

  • Create a store.js file in the utils directory. This file should do the following:

    • Import { createStore } from redux.

    • Import reducers from ./reducers.

    • Create a default export of createStore that accepts an argument of reducers.

  • Open /utils/CarContext.js and import { Provider } from react-redux and store from ./store.

  • Refactor the CarProvider component so that it returns <Provider> with an attribute of store, set to the value of store.

  • Clean up any unused code left over from the React Hooks.

  • Run the application, using npm run start, to ensure that functionality is unchanged for the end user.


๐Ÿ’ก Hints

How can we use the Redux Fundamentals guide to find examples of implementation?

What needs to be changed, if anything, inside the reducers.js file?

๐Ÿ† Bonus

If you have completed this activity, work through the following challenge with your partner to further your knowledge:

  • Instead of using React.createContext, how can we use Redux.createStore and the existing reducer to generate the initial state and to calculate any future updates?

Use Google or another search engine to research this.


ยฉ 2022 edX Boot Camps LLC. Confidential and Proprietary. All Rights Reserved.

redux-store's People

Contributors

oliverlo78 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.