import React from 'react' ; import { PrimaryButton } from '@workday/canvas-kit-react/button' ; import { FormField } from '@workday/canvas-kit-react/form-field' ; import { Radio , RadioGroup } from '@workday/canvas-kit-react/radio' ; export const RefForwarding = ( ) => { const [ value , setValue ] = React . useState < string | number > ( 'deep-dish' ) ; const glutenFreeRef = React . useRef ( null ) ; const handleChange = ( value ) => { setValue ( value ) ; } ; const handleClick = ( ) => { glutenFreeRef . current . click ( ) ; } ; return ( < > < FormField label = "Choose Your Pizza Crust" useFieldset = { true } > < RadioGroup name = "crust" onChange = { handleChange } value = { value } > < Radio label = "Deep dish" value = "deep-dish" / > < Radio label = "Thin" value = "thin" / > < Radio label = "Gluten free" ref = { glutenFreeRef } value = "gluten-free" / > < Radio label = "Cauliflower" value = "cauliflower" / > < /RadioGroup> < /FormField> < PrimaryButton onClick = { handleClick } > Select Gluten Free < /PrimaryButton> < />); } ;