🎨 Whitespace

This commit is contained in:
Malted 2023-04-06 22:48:09 +01:00
parent 64fe54b137
commit 7207898245
No known key found for this signature in database
GPG key ID: C1AF1C0E5180BE02

View file

@ -4,6 +4,7 @@ import VanillaTilt from 'vanilla-tilt'
// NOTE(@lachlanjc): only pass one child!
const Tilt = ({ options = {}, children, ...props }) => {
const root = useRef(null)
useEffect(() => {
VanillaTilt.init(root.current, {
max: 7.5,
@ -15,6 +16,7 @@ const Tilt = ({ options = {}, children, ...props }) => {
...options
})
}, [options])
return React.cloneElement(children, { ref: root })
}