From ee239dfc3401f9fccac99d18cb0aa70e6ef1e57a Mon Sep 17 00:00:00 2001 From: MapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Sun, 9 Jan 2022 02:11:53 -0600 Subject: [PATCH] cleaner flow in select (but there's also a bug oops) --- packages/reacord/playground/fruit-select.tsx | 16 ++++++++-------- packages/reacord/playground/main.tsx | 10 +++++++++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/packages/reacord/playground/fruit-select.tsx b/packages/reacord/playground/fruit-select.tsx index 2527de0..78118a8 100644 --- a/packages/reacord/playground/fruit-select.tsx +++ b/packages/reacord/playground/fruit-select.tsx @@ -1,17 +1,15 @@ import React, { useState } from "react" import { Button, Option, Select } from "../library/main" -export function FruitSelect() { +export function FruitSelect({ + onConfirm, +}: { + onConfirm: (choice: string) => void +}) { const [value, setValue] = useState() - const [finalChoice, setFinalChoice] = useState() - - if (finalChoice) { - return <>you chose {finalChoice} - } return ( <> - {"_ _"}