Skip to content

jan25/react-typing-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.