Skip to content

update documentation (dynamic content) #125

@ohzecodes

Description

@ohzecodes

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>


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions