Skip to content

Commit b3eea64

Browse files
authored
Update: Add an example with callback in the sequence
1 parent 63e1ebf commit b3eea64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ A common typewriter animation for a landing page could look like this:
3333
```jsx
3434
import { TypeAnimation } from 'react-type-animation';
3535

36-
const ExampleComponent = () => {
36+
const ExampleComponent = ({ onEndTypeAnimation }) => {
3737
return (
3838
<TypeAnimation
3939
sequence={[
@@ -46,6 +46,7 @@ const ExampleComponent = () => {
4646
1000,
4747
'We produce food for Chinchillas',
4848
1000,
49+
(element) => onEndTypeAnimation?.(element),
4950
]}
5051
wrapper="span"
5152
speed={50}

0 commit comments

Comments
 (0)