/* **************************************************************************************************
________ __ .___._.
\______ \ ____ _____________ ____ ____ _____ _/ |_ ____ __| _/| |
| | \_/ __ \\____ \_ __ \_/ __ \_/ ___\\__ \\ __\/ __ \ / __ | | |
| ` \ ___/| |_> > | \/\ ___/\ \___ / __ \| | \ ___// /_/ | \|
/_______ /\___ > __/|__| \___ >\___ >____ /__| \___ >____ | __
\/ \/|__| \/ \/ \/ \/ \/ \/
**************************************************************************************************** */This is the original project used to develop the React/Redux curriculum for freeCodeCamp. This curriculum has been migrated to freeCodeCamp and will be accessible there from now on. Any issues related to these challenges should be posted in the freeCodeCamp Github. This project is now deprecated and will not be maintained any further.
The original challenges (which require an out of date version of Enzyme), will continue living at their original home.
freeCodeCamp React/Redux Curriculum
This repository contains the code for the Alpha version of the freeCodeCamp React/Redux Curriculum Expansion.
Overview:
- 50 React Challenges
- 18 Redux Challenges
- 10 React-Redux Challenges
Curriculum Map:
β Challenge is fully QA'd and ready to shipπ Challenge has been reviewed and is ready for QA
React Challenges:
-
Introducing JSX Elements
β π 1: Create a Simple JSX elementβ π 2: Create a Complex JSX Elementβ π 3: Add Comments in JSX (may need to revise test for comment)β π 4: Render HTML Elements to the DOMβ π 5: Define an HTML Class in JSXβ π 6: Learn About Self-Closing JSX Tags
-
Introducing React/Components
β π 7: Create a Stateless Functional Component (introduce ES6 arrow syntax here?)β π 8: Create a Component with Reactβ π 9: Create a Component with Compositionβ π 10: Use React to Render Nested Componentsβ π 11: Compose React Componentsβ π 12: Render a Class Component to the DOMβ π 13: Write a React Component from Scratch
-
Props
β π 14: Pass a String to a Functional Componentβ π 15: Pass an Array as Propsβ π 16: Use Default Propsβ π 17: Override Default Props (cannot checkdefaultPropson child)β π 18: Use PropTypes to Define the Props You Expect (regex.includestest forpropTypes)β π 19: Access Props Using this.propsβ π 20: Using Props with Stateless Functional Components (regex.includestest forpropTypes)
-
State
β π 21: Create a Stateful Componentβ π 22: Render State in the UIβ π 23: Render State in the UI Another Wayβ π 24: Set State with this.setStateβ π 25: Bind 'this' to a Class Methodβ π 26: Bind 'this' with an ES6 Arrow Functionβ π 27: Use State to Toggle an Elementβ π 28: Write a Simple Counterβ π 29: Create a Controlled Inputβ π 30: Create a Controlled Formβ π 31: Pass State as Props to Child Componentsβ π 32: Pass a Callback as Props
-
Component Lifecycle
β π 33: Use the Lifecycle Method componentWillMountβ π 34: Use the Lifecycle Method componentDidMountβ π 35: Add Event Listeners is the explanation correct?β π 36: Manage Updates with Lifecycle Methodsβ π 37: Optimize Re-Renders with shouldComponentUpdate
-
Advanced Rendering
β π 38: Introducing Inline Stylesβ π 39: Add Inline Styles in Reactβ π 40: Use Advanced JavaScript in React Render Methodβ π 41: Render with an If/Else Conditionβ π 42: Use && for a More Concise Conditionalβ π 43: Return null to Prevent Renderingβ π 44: Use a Ternary Expression for Conditional Renderingβ π 45: Render Conditionally from Propsβ π 46: Change Inline CSS Conditionally Based on Component Stateβ π 47: Use Array.map() to Dynamically Render Elementsβ π 48: Give Sibling Elements a Unique Key Attributeβ π 49: Use Array.filter() to Dynamically Filter an Arrayβ π 50: Render React on the Server with renderToString
Redux Challenges:
-
Basic Redux: Store, Actions, & Reducers
β π 1: Create a Redux Storeβ π 2: Get the State of the Redux Storeβ π 3: Define a Redux Actionβ π 4: Define an Action Creatorβ π 5: Dispatch an Action Eventβ π 6: Handle an Action in the Storeβ π 7: Use a Switch Statement to Handle Multiple Actionsβ π 8: Use const for Action Typesβ π 9: Register a Store Listenerβ π 10: Combine Multiple Reducersβ π 11: Send Action Data to the Storeβ π 12: Use Middleware to Handle Asynchronous Actions (Async testing... hacked with regex of course)β π 13: Write a Counter with Redux
-
Enforcing State Immutability
β π 14: Never Mutate Stateβ π 15: Use the Spread Operator on Arraysβ π 16: Remove an Item from an Arrayβ π 17: Copy an Object with Object.assignβ π 18: Use the ES6 Spread Operator with Objects
React-Redux Challenges:
-
Use
react-reduxto Manage a List of Messagesβ π 1: Getting Started with React Reduxβ π 2: Manage State Locally Firstβ π 3: Extract State Logic to Reduxβ π 4: Use Provider to Connect Redux to Reactβ π 5: Map State to Propsβ π 6: Map Dispatch to Propsβ π 7: Connect Redux to Reactβ π 8: Connect Redux to the Messages Appβ π 9: Extract Local State into Reduxβ π 10: Moving Forward From Here
To run this project locally, clone the repository, install the dependencies, and run npm start. Now you can view all the finished challenges live in the browser.
This project is running tests against React components, ES6 code, and plain JavaScript which users write directly into an in-browser code editor. To accomplish this we are using the Babel standalone package to transpile JavaScript and the testing library Enzyme to conduct tests. At a basic level the tests we're writing for React components generally look like this:
assert(Enzyme.mount(<App />).type() === 'div', 'The component renders a div element');This project was bootstrapped with Create React App.

