This repository contains the code for the Alpha version of the freeCodeCamp React/Redux Curriculum Expansion.
- 50 React Challenges
- 18 Redux Challenges
- 10 React-Redux Challenges
The now live Beta Version of freeCodeCamp's expanded curriculum redirects campers to a separate host site for these React challenges, while we work on merging them into the FCC platform. Eventually, the goal is for all of these challenges to be moved directly into the freeCodeCamp codebase.
Currently, we have finished the initial QA and review of all of these challenges and are quite happy with them. There is still a possibility that there are bugs or typos we have not found yet. If you find something you think needs to be fixed, or have a suggestion for any of the challenges, please open an Issue here first so we can discuss it.
- โ Challenge is fully QA'd and ready to ship
- ๐ Challenge has been reviewed and is ready for QA
-
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 check
defaultProps
on child) - โ
๐ 18: Use PropTypes to Define the Props You Expect (regex
.includes
test forpropTypes
) - โ ๐ 19: Access Props Using this.props
- โ
๐ 20: Using Props with Stateless Functional Components (regex
.includes
test 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
-
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
-
Use
react-redux
to 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.strictEqual(shallowRender.type(), 'div', 'The component renders a div element');
This project was bootstrapped with Create React App.