0.1.2 • Published 3 years ago

@jan25/react-typing-hook v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-typing-hook

Simple React Hook to manage state for auto typing text.

Sample Usage

npm i --save @jan25/react-typing-hook
import useAutoType from '@jan25/react-typing-hook';

export default function App() {
  const [text, setText] = useState(randomText())
  const currentText = useAutoType(text)

  return (
    <div>
      <div className="App" style={{textAlign: "center"}}>
        <button onClick={() => setText(randomText())}>Another text</button>
        { currentText }
      </div>
    </div>
  );
}

See example app in the Github repository.