Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

React Hooks Bowl of Fruit

Public visualization

React Hooks Bowl of Fruit

0 stars0🌍 Public
Vvaporpin
Last edited Oct 28, 2020
Created on Oct 28, 2020

A React Hooks bowl of fruit renders five apples as circles in an SVG, with a black outline highlighting the currently selected fruit when clicked. The example demonstrates state management via `useState` for both the fruit array and the selected fruit ID, passing them to a functional `FruitBowl` component. Using D3 v5’s `scaleOrdinal` for color and radius mappings, it sets circle properties dynamically, enabling interactive selection through React event handlers.

AI-generated description

Trying out React Hooks.

Comments

Sign in to join the discussion.

MIT Licensed