import { useState } from 'react' ; export function useStringifiedValue ( initialValue ) { const [ value , setValueInner ] = useState ( stringify ( initialValue ) ) ; function stringify ( f ) { return f === null ? '' : f ; } function setValue ( f ) { setValueInner ( stringify ( f ) ) ; } return { value , setValue } ; }