File tree 1 file changed +9
-39
lines changed
1 file changed +9
-39
lines changed Original file line number Diff line number Diff line change @@ -70,34 +70,10 @@ export const Hello: StoryObj = {
70
70
</ g >
71
71
</ svg >
72
72
< div >
73
- < button
74
- onClick = { ( ) => {
75
- animate . play ( ) ;
76
- } }
77
- >
78
- play
79
- </ button >
80
- < button
81
- onClick = { ( ) => {
82
- animate . pause ( ) ;
83
- } }
84
- >
85
- pause
86
- </ button >
87
- < button
88
- onClick = { ( ) => {
89
- animate . reverse ( ) ;
90
- } }
91
- >
92
- reverse
93
- </ button >
94
- < button
95
- onClick = { ( ) => {
96
- animate . finish ( ) ;
97
- } }
98
- >
99
- finish
100
- </ button >
73
+ < button onClick = { animate . play } > play</ button >
74
+ < button onClick = { animate . pause } > pause</ button >
75
+ < button onClick = { animate . reverse } > reverse</ button >
76
+ < button onClick = { animate . finish } > finish</ button >
101
77
</ div >
102
78
< div >
103
79
< label >
@@ -382,7 +358,7 @@ export const Square: StoryObj = {
382
358
width : "6rem" ,
383
359
margin : "2rem 0 2rem 2rem" ,
384
360
} }
385
- > </ div >
361
+ / >
386
362
) ;
387
363
} ,
388
364
} ;
@@ -398,13 +374,9 @@ export const Toggle: StoryObj = {
398
374
animate . play ( ) ;
399
375
} , [ animate ] ) ;
400
376
401
- const onClick = useCallback ( ( ) => {
402
- animate . reverse ( ) ;
403
- } , [ animate ] ) ;
404
-
405
377
return (
406
378
< div >
407
- < button onClick = { onClick } > Toggle</ button >
379
+ < button onClick = { animate . reverse } > Toggle</ button >
408
380
< div className = "rail" >
409
381
< div ref = { animate . ref } className = "block" />
410
382
</ div >
@@ -455,11 +427,9 @@ export const Path: StoryObj = {
455
427
const height = 300 ;
456
428
457
429
return (
458
- < >
459
- < svg width = { width } height = { height } viewBox = { `0 0 ${ width } ${ height } ` } >
460
- < path ref = { animate . ref } fill = "orange" />
461
- </ svg >
462
- </ >
430
+ < svg width = { width } height = { height } viewBox = { `0 0 ${ width } ${ height } ` } >
431
+ < path ref = { animate . ref } fill = "orange" />
432
+ </ svg >
463
433
) ;
464
434
} ,
465
435
} ;
You can’t perform that action at this time.
0 commit comments