Skip to content

Instantly share code, notes, and snippets.

View seanconnelly34's full-sized avatar

seanconnelly34

View GitHub Profile
@seanconnelly34
seanconnelly34 / Sum.tsx
Created October 4, 2022 17:18
Sum component that retruns sum, and toggles display or sum with radio buttons
import React, { useState, useMemo } from "react";
interface ISumProps {
values: number[];
}
const Sum = ({ values }: ISumProps) => {
const [showSum, setShowSum] = useState<boolean>(false);
const sum = useMemo(