Add onValueChange hook to send data up
This commit is contained in:
parent
01db78c422
commit
97fb9420db
1 changed files with 2 additions and 1 deletions
|
|
@ -5,11 +5,12 @@ import './index.scss'
|
|||
|
||||
interface Props {
|
||||
currentElement: number
|
||||
sendValue: (value: string) => void
|
||||
}
|
||||
|
||||
const ElementToggle = (props: Props) => {
|
||||
return (
|
||||
<ToggleGroup.Root className="ToggleGroup" type="single" defaultValue={`${props.currentElement}`} aria-label="Element">
|
||||
<ToggleGroup.Root className="ToggleGroup" type="single" defaultValue={`${props.currentElement}`} aria-label="Element" onValueChange={props.sendValue}>
|
||||
<ToggleGroup.Item className="ToggleItem" value="0" aria-label="null">
|
||||
Null
|
||||
</ToggleGroup.Item>
|
||||
|
|
|
|||
Loading…
Reference in a new issue