Using custom hooks in Ionic

Hi,

Is it possible to use Custom hooks in Ionic? I am not talking about the ones included in capacitor core, like useGeolocation. I am talking about react custom hooks, for example

const useField = (type: any) => {
  const [value, setValue] = useState('')

  const onChange = (event: any) => {
    setValue(event.target.value)
  }

  return {
    type,
    value,
    onChange
  }
}
const App = () => {
const person = useField('text')
}

Thanks

What happens when you run the code? Any errors? Any additional code that might be helpful to debug?

Hi, thanks for the reply.

I found the source of the error. I was writing const [person, setPerson] = useField('text') instead of
const person = useField('text').

Thanks again for the reply.