Skip to main content
100%

React Hooks Bowl of Fruit

✓ Published0🌍 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.

MIT Licensed

Similar vizzes