auto-write
v0.0.5
Published
auto writes a text you specified with interval time you specified in an html element
Downloads
61
Readme
Auto Writer
- This Is A Function That Auto Writes A Text To Element Intervaly.
Use With React
First create react app using
npm create vite
then write project name and choose React then type (Javascript - Javascript + SWC - Typescript - Typescript + SWC).Second install using
npm i auto-write
.Third Write The Code In
App.jsx
OrApp.tsx
Like This 👇.
import { useRef } from 'react'
function App() {
const ref = useRef(null);
let i = setInterval(() => {
if (ref.current != null) {
autoWrite({ element: ref.current, text: 'lorem ipsum dolor mit ami dext', interval: 50 })
clearInterval(i);
}
}, 1);
return (
<>
<h1 ref={ref}></h1>
</>
)
}
export default App
- Run the command
pnpm install
thenpnpm dev
and see the effect.