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
* Fixing access to Skia Values from UI Thread Previously the following would crash: ```ts const x = useValue(50); const y = useValue(50); const gesture = useMemo( () => Gesture.Pan().onChange(({ changeX, changeY }) => { x.current += changeX; y.current += changeY; }), [] ); ``` This was caused by the Skia Values storing its value in a JS object for fast access causing a crash when trying to write to this value from another runtime (REA / Main UI Thread) This commit updates the Skia Value to use the JsiValue class instead - which unwraps / wraps the value to native primitives. There might be a small overhead doing this, but I've not been able to measure such a thing. Fixes Skia value can't update on UI thread #1626 * Fix lint * Fix ci --------- Co-authored-by: William Candillon <[email protected]>
- Loading branch information