3

react-typewriter-hook

⌨️ 使用react hooks来轻松实现打字机的效果

https://github.com/haowen737/react-typewriter-hook/blob/master/doc/example.gif

安装

npm i react-typewriter-hook --save

例子

View example at codesandbox

使用

// useTypewriter will do these things
// Once Word changed, typewritter will automatically erase last word
// Then type down new word
import useTypewriter from "react-typewriter-hook"

function MagicWriter(word) {
  const typing = useTypewriter(word)
  return typing
}

Haowen
41 声望2 粉丝

Live a life you will remember!