GithubHelp home page GithubHelp logo

braisc / react-text-typist Goto Github PK

View Code? Open in Web Editor NEW
31.0 1.0 5.0 1.1 MB

React component that simulates human typing on a keyboard.

Home Page: https://www.npmjs.com/package/react-text-typist

JavaScript 16.03% TypeScript 83.02% SCSS 0.95%
react react-component react-library npm-package typing-animation typing-effect typescript

react-text-typist's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-text-typist's Issues

Implementing an Event Listener for Detecting End of Typing in a React Typist Component

I need a way to detect when Typer has finished typing.

In my app, I would like to disable the "Request" button until Typist finishes typing to prevent spam clicking. How can I do that?

Couple of ways I thought I might be implemented (but since its not supported in the package yet) are as follows

              <Typer
                sentences={[output]}
                startDelay={0}
                typingSpeed={7}
                pauseTime={250}
                cursorColor="black"
                showCursor={true}
                hideCursorOnFinish={true}
                loop={false}
                onEvent={(event) => {
                  if (event === "startTyping") {
                    setTyping(true);
                  } else if (event === "finishTyping") {
                    setTyping(false);
                  }
                }}
              />

or

import Typer, { TyperEvent } from "react-text-typist";

              <Typer
                sentences={[output]}
                startDelay={0}
                typingSpeed={7}
                pauseTime={250}
                cursorColor="black"
                showCursor={true}
                hideCursorOnFinish={true}
                loop={false}
                onTyped={() => setTyping(true)}
                onFinishedTyping={() => setTyping(false)}
              />

Please let me know if there is a way to do this already.

Thank you

Clear out all timeouts

Thanks for putting this together.

You probably need to clear out all setTimeout handlers on component unmount, otherwise, you most likely will get the memory leak warning.

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

Please let me know if I need to submit a PR.

typingSpeed is incorrectly referred to in the docs

Firstly, love the library. Small and simple, it's exactly what I was looking for.

Just wanted to point out a small issue with the readme that caught me off guard, it refers to "writeSpeed" which it looks like you have since renamed to typingSpeed.

Thanks for the hard work!

1.1.4 typing speed is super slow

I was just testing out this package and the 1.1.4 seems to have a bug with the typing speed? I re-installed version 1.1.0 and it worked fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.