react-cardlist
Goals
Copying and pasting cards is tedious, so we create a
CardList
componentHard-code the data as an array in
robots.js
to start with
Connecting the Pieces
Then pass that array to
CardList
inindex.js
The Card List
CardList
transforms the array of values into an array of views usingmap
Wraps that array in a
div
because it can only return one thingJSX automatically concatenates array elements for us
PropTypes
Tell React that the
robots
array is required
Last updated
Was this helpful?