We should add integration with react-native-reanimated shared values.
The integration should add listeners to shared values so that when a value changes the SkiaView / Canvas is repainted.
The integration should not add a hard dependency on Reanimated. If Reanimated is installed, the hook should work - if not it should emit a warning.
The integration should be implemented as a hook called useSharedValueEffect and the signature will be like this:
/**
* Connects a shared value from reanimated to a SkiaView or Canvas
* so whenever the shared value changes the SkiaView will redraw.
* @param ref Reference to the SkiaView or Canvas
* @param value Shared value to add change listeners for
* @param values Additional (optional) shared values to add change listeners for
*/
export type useSharedValueEffectType = <T = number>(
ref: RefObject<SkiaView>,
value: SharedValueTypeWrapper<T>,
...values: SharedValueTypeWrapper<T>[]
) => void;
We should add integration with react-native-reanimated shared values.
The integration should add listeners to shared values so that when a value changes the SkiaView / Canvas is repainted.
The integration should not add a hard dependency on Reanimated. If Reanimated is installed, the hook should work - if not it should emit a warning.
The integration should be implemented as a hook called
useSharedValueEffectand the signature will be like this: