-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
kind: requestNew feature or request that should be actionedNew feature or request that should be actioned
Description
Issue: 🚀 Feature Proposal
Thank you for this amazing animation library!
I've been wondering if there's any way for the animated component to be avoided at all by passing the ref directly to useSpring(s)
. As far as I understand, the animated component is used only so that there is access to the ref (to directly set styles) and otherwise props are just passed down, but maybe I'm missing something here.
Motivation
We'd like to create a hook that would contain useSpring
that has access to the ref.
Example
What I'm proposing would be this:
const ref = useRef();
useSpring( { opacity: ..., target: ref } );
return <div ref={ ref } { ...otherProps } />;
Metadata
Metadata
Assignees
Labels
kind: requestNew feature or request that should be actionedNew feature or request that should be actioned