-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Description
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
Labels
No labels