Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fixed issue with dependency-manager's update If you mount / unmount / mount a component, the dependency manager's update method is not called correctly causing a missing detection of the precense of an animation value - making the animation stuck. This PR fixes this by updating the dependency manager after a commit phase in the reconciler - In addition it eases the error message given by the canvas component if you try to call the registerValues method when canvas is null. It is not possible to make a unit test for this problem - since it is related to an animation and some complex omount/unmount stuff. The following example shows the bug (a green rect is mounted/unmounted repeatedly, and the animation should pick up immediately after it is mounted.) ```ts import React, { useEffect, useState } from "react"; import { Canvas, Circle, mix, Rect, useComputedValue, useLoop, } from "@shopify/react-native-skia"; const App = () => { return ( <Canvas style={{ flex: 1 }}> <Circle cx={100} cy={100} r={50} color="red" /> <Mounter /> </Canvas> ); }; function Mounter() { const [showRect, setShowRect] = useState(false); useEffect(() => { const t = setInterval(() => { setShowRect((p) => !p); }, 1000); return () => clearInterval(t); }, []); if (!showRect) { return null; } return <RectComp />; } function RectComp() { const loop = useLoop(); const height = useComputedValue(() => mix(loop.current, 100, 200), [loop]); return <Rect x={0} y={0} width={100} height={height} color="green" />; } // eslint-disable-next-line import/no-default-export export default App; ``` * Removed superflous call to dependency manager's update function * Fix CI * Kept hostDebug
- Loading branch information