-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
🧠 Feature Request: Support for ts-pattern.match()
inside Reanimated worklets
I'm requesting support for using ts-pattern
's match()
function inside worklets
🧪 Current Behavior
Using ts-pattern.match
inside a worklet results in the following runtime
ts-pattern.match() causes [Reanimated] Tried to synchronously call a non-worklet function on the UI thread
💡 Why This Matters
-
ts-pattern enables exhaustive, type-safe pattern matching in TypeScript.
-
Many developers reach for this library to improve control flow and readability, including in animations or shared UI logic.
-
However, worklet context throws errors because match() creates closures and uses non-serializable logic.
Metadata
Metadata
Assignees
Labels
No labels