useResponsiveInput
useResponsiveInput is a React hook that makes any input component responsive to it's text's width.
Installation
npm
npm install react-use-responsive-input
Yarn
yarn add react-use-responsive-input
Example
import { useState } from 'react'
import useResponsiveInput from 'react-use-responsive-input'
const ResponsiveInput = () => {
const [value, setValue] = useState('')
const responsiveInputRef = useResponsiveInput()
return (
<input
ref={responsiveInputRef}
value={value}
onChange={e => setValue(e.target.value)}
/>
)
}