Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Using custom hooks in Ionic

$
0
0

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

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>