Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update documentation (dynamic content) #125

Open
ohzecodes opened this issue May 18, 2022 · 0 comments
Open

update documentation (dynamic content) #125

ohzecodes opened this issue May 18, 2022 · 0 comments

Comments

@ohzecodes
Copy link

ohzecodes commented May 18, 2022

Developers can use the on typing done method when to give a dynamic text looping through the array. The typist can then be compiled with delay and backspace to delete and give a dynamic feeling.

Kindly update the section with Dynamic content usage in your documentation with the following code.

let texts=["one","two","three" ]
const [currentTextCounter, setCurrentTextCounter] = useState(0);

<Typist
          key={currentTextCounter}
          onTypingDone={() => {
            if (currentTextCounter < texts.length - 1) {
              setCurrentTextCounter(currentTextCounter + 1);
            } else {
              setCurrentTextCounter(0);
            }
          }}  >
          {texts[currentTextCounter]}
           </Typist>


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant