-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 🎸 Add See More Section #428
base: main
Are you sure you want to change the base?
Conversation
useEffect(() => { | ||
if (!containerRef.current) return | ||
|
||
const updateWidth = (entries: ResizeObserverEntry[]) => { | ||
setWidth(entries[0].contentRect.width) | ||
} | ||
|
||
const resizeObserver = new ResizeObserver(updateWidth) | ||
resizeObserver.observe(containerRef.current) | ||
|
||
return () => resizeObserver.disconnect() | ||
}, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: let's move this to a custom hook. We could make it reusable and return the width and height.
|
||
pathRef.current?.setAttribute('d', `M${path}`) | ||
|
||
requestRef.current = requestAnimationFrame(animate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to use a ref for this. We can use a local variable.
Related to #384