Handling expiration

By default, you don't need to handle the widget expiring, unless you set options.refreshExpired to 'manual' or 'never'.

Here is an example of how to reset the widget when it expires:

import { Turnstile } from '@marsidev/react-turnstile'

export default function Widget() {
  const ref = React.useRef()

  return (
    <Turnstile
      ref={ref}
      options={{ refreshExpired: 'manual' }}
      siteKey='1x00000000000000000000AA'
      onExpire={() => ref.current?.reset()}
    />
  )
}