MCPcopy Index your code
hub / github.com/reactchartjs/react-chartjs-2 / onAdd

Function onAdd

stories/Pie.stories.tsx:34–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32export const Dynamic = args => {
33 const [datasets, setDatasets] = useState(() => [randomDataset()]);
34 const onAdd = () => {
35 setDatasets(datasets => [...datasets, randomDataset()]);
36 };
37 const onRemove = () => {
38 setDatasets(datasets => datasets.slice(0, -1));
39 };

Callers

nothing calls this directly

Calls 2

setDatasetsFunction · 0.85
randomDatasetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…