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
}