react-outline
Goal
We are going to make a Robodex
![Robodex Screenshot]()
Creating a Card
Delete
HelloComponent
and start building the app with aCard
componentStart by creating
Card
as a stateless component inCard.js
with hardcoded mock data
Convert the hard-coded values into
id
,name
, andemail
props
Customizing the Cards
Then add JSON data to make each card different
robots.js
is available from the lesson 3 folder in the repo
Use destructuring to get values out of props
Static Checking with PropTypes
Install
prop-types
package and implement this:
Checks the properties being passed into components
Styling
Add classes to the
Card
component
Note use of back-quoted string as
src
attribute ofimg
JavaScript string interpolation
But no quotes around the overall expression
JSX does that for us
Side note: the
src
URL doesn't have a protocolIt will use HTTP or HTTPS depending on what the page used
Last updated
Was this helpful?