import React from 'react' ; import { PrimaryButton } from '@workday/canvas-kit-react/button' ; import { Checkbox } from '@workday/canvas-kit-react/checkbox' ; import { Box } from '@workday/canvas-kit-labs-react/common' ; export const RefForwarding = ( ) => { const [ checked , setChecked ] = React . useState ( false ) ; const ref = React . useRef ( null ) ; const handleChange = ( event ) => { setChecked ( event . target . checked ) ; } ; const handleClick = ( ) => { ref . current . click ( ) ; } ; return ( < > < Box marginBottom = "s" > < Checkbox checked = { checked } label = "I agree to the terms" onChange = { handleChange } ref = { ref } / > < /Box> < PrimaryButton onClick = { handleClick } > Check Agreement to Terms < /PrimaryButton> < />); } ;