As Matrix4 is declared as a readonly array, it is impossibile to re-assign it as an AnimatableValue and to properly animate some transitions. I know this is expected behavior, but any idea on how to implement the following code maintaining the readonly type safety?
Code example:
import { useSharedValue, withTiming } from 'react-native-reanimated';
import { identity4 } from 'react-native-redash';
const matrix = useSharedValue(identity4); // matrix is expected to be mutable
matrix.value = withTiming(identity4); // This assignment attempts to assign a readonly array to a mutable one
Error:
Argument of type 'Matrix4' is not assignable to parameter of type 'AnimatableValue'.
The type 'readonly [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]' is 'readonly' and cannot be assigned to the mutable type 'number[]'.ts(2345)
As Matrix4 is declared as a readonly array, it is impossibile to re-assign it as an AnimatableValue and to properly animate some transitions. I know this is expected behavior, but any idea on how to implement the following code maintaining the readonly type safety?
Code example:
Error: