import { useState } from 'react' ; export function useInputValue ( initialValue ) { const [ value , setValue ] = useState ( initialValue ) ; function onChange ( event ) { setValue ( event . currentTarget . value ) ; } return { value , onChange , } ; }