chakra-ui / chakra-ui-docs

Documentation website for chakra ui
https://chakra-ui.com
MIT License
301 stars 477 forks source link

docs:updated useRadio snippets #1517

Closed Riley1101 closed 1 year ago

Riley1101 commented 1 year ago

Closes #1515

📝 Description

Updated custom radio docs #Custom-radio-buttons from #1515

⛳️ Current behavior (updates)

The useRadio hook states that getCheckboxProps is deprecated. In the example, the following code snippet:

function RadioCard(props) {
  const { getInputProps, getCheckboxProps } = useRadio(props)

  const input = getInputProps()
  const checkbox = getCheckboxProps()

should be

function RadioCard(props) {
  const { getInputProps, getRadioProps } = useRadio(props)

  const input = getInputProps()
  const checkbox = getRadioProps()

🚀 New behavior

function RadioCard(props) {
  const { getInputProps, getRadioProps } = useRadio(props)

  const input = getInputProps()
  const checkbox = getRadioProps()

💣 Is this a breaking change (No):

📝 Additional Information

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
chakra-ui-docs ✅ Ready (Inspect) Visit Preview Apr 5, 2023 8:53pm
Riley1101 commented 1 year ago

useRadio

Right ! got it thanks !