Bootcamp
Search…
Bootcamp
Welcome to Bootcamp!
🛠
Logistics
📚
General Reference
🏞
Projects
0: Language and Tooling
1: Frontend Basics
🌈
CSS
2: Backend Basics
3: Backend Applications
4: Backend Structure
5: Full-Stack Applications
6: Frontend Infrastructure
7: React
7.0: Module 7 Overview
7.1: JSX Intro
7.2: React Components
7.3: Using React with Express and Webpack
7.4: React State
7.5: Controlled Forms
7.6: Passing Data Between Sibling Components
7.7: Designing Component Hierarchy
7.8: Error Boundaries
7.9: React DevTools
7.ICE: In-Class Exercises
7.ICE.1: Product Rendering
7.ICE.2: Pokedex
7.ICE.3: React Cards
7.ICE.4: Guess the Word
7.ICE.5: Create Item
7.POCE: Post-Class Exercises
8: Advanced React
9: Advanced Topics
🧮
Algorithms
💼
Interview Prep
☺
User Experience
Powered By
GitBook
7.ICE.1: Product Rendering
Introduction
Render an array of objects using JSX.
Setup
1.
Begin with the base Webpack repo:
https://github.com/rocketacademy/webpack-mvc-base-bootcamp.git
2.
Follow the instructions in
Module 7.1: JSX Intro
to set up Webpack for React.
3.
Copy the contents of
this JSON file
into
index.jsx
. Conversely, you can also make a module for this data if you want.
1.
This means copying the data and pasting it into a new
data.json
file
2.
In your
index.jsx
file, import the data with
import data from './data.json'
Base
Render the data in the array onto the screen. The HTML should look like this: (R_emember to add the 'key' attribute for your mapped element!)_
<
ul
>
<
li
>
<
p
>
id: 1
</
p
>
<
p
>
name: Car
</
p
>
<
p
>
description: The Apollotech B340 is an affordable wireless mouse with reliable connectivity, 12 months battery life and modern design
</
p
>
<
p
>
created: 2020-12-28T09:02:15.112Z
</
p
>
<
p
>
updated: 2020-12-28T09:02:15.112Z
</
p
>
</
li
>
[...]
</
ul
>
Comfortable
1.
Install
Moment.js
and format the dates to
time from now.
2.
Use CSS so that the background colour of the items alternate between white and grey.
Previous
7.ICE: In-Class Exercises
Next
7.ICE.2: Pokedex
Last modified
3mo ago
Copy link
Outline
Introduction
Setup
Base
Comfortable