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. |
| } from "@shopify/react-native-skia"; | ||
|
|
||
| const myComponent = () => { | ||
| const progress = useProgress(); |
There was a problem hiding this comment.
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.
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