【分享创造】react-typewriter-hook: 用react hooks来实现打字机的效果

react-typewriter-hook

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

安装

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
}

评论

暂无评论