Skip to content

hidding the cursor after a map item has been rendered.  #17

@king112ola

Description

@king112ola

Hello guys. I hope you are all doing well.

i would like to know if there is a short hand for disabling the cursor for a mapped component after the loop is done.

i have tried the onLoopDone function provided, but this won't work if the the typewriter is nested inside a continuously updating component.

For example,

const [cursorOn,setCursorOn]  = useState(true)

message.map(item=>{
return(
   <Typewriter cursor={cursorOn} onLoopDone={()=>setCursorOn(false)}>{item}</Typewriter>
)})

i thought of creating a cursor on off state for each component inside a map, but i hope there is an easier way that the cursor will be automatically disabled after the loop has been completed.

Apperciate it.

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