-
Notifications
You must be signed in to change notification settings - Fork 463
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
Feature/22 reanimated connector #23
Conversation
The effect is only active if react-native-reanimated is installed.
- Exported invalidateSkiaView method - Updated useSharedValueEffect after test install of Renimated
…ated is not installed.
- Added documentation page - Updated animation docs with twoslash
Great, Would it be ok to add reanimated and gesture handler as the dep to the example project and add a demo of the feature or would it have some potential unintentional side-effects? This branch doesn't pass the typescript due to #21 |
If we had reanimated 2 a dep of the documentation, would the two slash examples work? No strong opinion there. |
docs/docs/animations/overview.md
Outdated
interpolate, | ||
useProgress, | ||
} from "@shopify/react-native-skia"; | ||
|
||
const myComponent = () => { | ||
const progress = useProgress(); |
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.
here we use useProgress without prior mentioning.
Do we want to expose it?
It feels almost identical to remotion useFrame() which is the single hook you need to build any animation in remotion. However, our case is a bit different since we have nondeterministic animations and side-effects to animations (such as stopping/pausing).
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.
Yes, useFrame is a bit different than useProgress - since useFrame actually gives you the frame number and not the time passed since start.
Maybe could just mark the whole animation page as "in progress"/"subject to change" to send a strong signal about this not being ready and final? And then decide about animations when we've released the alpha? |
👍🏻 my only review comment is #25. |
Update overview.md
Added implementation according to #22
The integration add listeners to shared values so that when a value changes the SkiaView / Canvas is repainted.
The integration does not add a hard dependency on Reanimated. If Reanimated is installed, the hook should work - if not it should emit a warning.
The solution has been tested both with and without reanimated installed.
The integration is implemented as the hook
useSharedValueEffect
:closes #22