Skip to main content
100%

Rendering Data With React

✓ Published1🌍 Public
JJames Rhodes
Last edited Feb 13, 2022
Created on Feb 13, 2022

This example shows a horizontal bar of CSS colors, one stripe per color, rendered as a 960-pixel-wide strip of 4-pixel-tall divs. It fetches a CSV of CSS color names and hex values from a GitHub gist using `d3.csv`, then maps each row to a React component. The React app uses `useEffect` and `useState` to load the data asynchronously, displaying a “Loading…” message until the data arrives, and `ReactDOM.render` mounts the component to the DOM.

AI-generated description

Example of rendering data using React

data MDN: CSS Colors

MIT Licensed

Similar vizzes