File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change 55
55
'max-glare' : 0.5 ,
56
56
}
57
57
VanillaTilt . init ( tiltNode , vanillaTiltOptions )
58
- return ( ) => tiltNode . vanillaTilt . destroy ( )
58
+ return ( ) => {
59
+ tiltNode . vanillaTilt . destroy ( )
60
+ }
59
61
} , [ ] )
60
62
61
63
return (
65
67
)
66
68
}
67
69
68
- const element = (
69
- < Tilt >
70
- < div className = "totally-centered" > vanilla-tilt.js</ div >
71
- </ Tilt >
72
- )
70
+ function App ( ) {
71
+ const [ showTilt , setShowTilt ] = React . useState ( true )
72
+ return (
73
+ < div >
74
+ < label >
75
+ < input
76
+ type = "checkbox"
77
+ checked = { showTilt }
78
+ onChange = { e => setShowTilt ( e . target . checked ) }
79
+ /> { ' ' }
80
+ show tilt
81
+ </ label >
82
+ { showTilt ? (
83
+ < Tilt >
84
+ < div className = "totally-centered" > vanilla-tilt.js</ div >
85
+ </ Tilt >
86
+ ) : null }
87
+ </ div >
88
+ )
89
+ }
73
90
74
- ReactDOM . render ( element , document . getElementById ( 'root' ) )
91
+ ReactDOM . render ( < App /> , document . getElementById ( 'root' ) )
75
92
</ script >
76
93
</ body >
You can’t perform that action at this time.
0 commit comments