From 3e3e29527f7bf7b72363a1193b3ee310b1adc2fa Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 6 May 2022 18:42:05 +0400 Subject: feat: allow removing solutions --- src/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index c6cab71..1bdd41a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -19,6 +19,10 @@ const App: React.FC = () => { setSolutions([{ author, result }, ...solutions]); } + const handleRemoveSolution = (index: number) => { + setSolutions(solutions.filter((_, i) => i !== index)); + } + return ( <>

Timer

@@ -26,9 +30,10 @@ const App: React.FC = () => {

Results

-- cgit v1.2.3