animation-with-worklets

Schedule functions between JS and UI threads in React Native with react-native-worklets.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/jp2507-max/growbro-cultivation-app --skill animation-with-worklets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: animation-with-worklets
Source: https://github.com/jp2507-max/growbro-cultivation-app/tree/main/.github/skills/animation-with-worklets
Command: npx skills add https://github.com/jp2507-max/growbro-cultivation-app --skill animation-with-worklets

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cross-thread coordination in React Native can be error-prone and hard to reason about. This Skill provides clear guidelines to safely schedule functions between the JavaScript thread and the UI thread using worklets, reducing bugs in animations and gesture handling.

Core Features & Use Cases

  • Define functions outside inline using a stable reference and schedule them on the appropriate thread with the recommended helpers.
  • Avoid unnecessary worklet directives and prefer automatic conversion when using scheduleOnRN and scheduleOnUI.
  • Use cases include coordinating animation state updates, gesture-driven interactions, and cross-thread function calls in animation pipelines.

Quick Start

To begin, create a stable function with a useCallback hook and call scheduleOnRN or scheduleOnUI with that function reference in your animation or gesture handler code.

Frequently Asked Questions about animation-with-worklets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely schedule functions between JS and UI threads in React Native?

Use react-native-worklets scheduleOnRN and scheduleOnUI instead of runOnJS and runOnUI for cross-thread coordination. Define functions outside inline using a stable useCallback reference and let scheduleOnRN and scheduleOnUI handle automatic worklet conversion, preventing gesture handling bugs.

Why should I use scheduleOnUI instead of runOnUI for React Native animations?

You should use scheduleOnUI instead of runOnUI because it supports automatic worklet conversion and reduces unnecessary worklet directives. This approach ensures correct worklet execution within React Native animation pipelines and cross-thread function calls.

How do I update animation state from a gesture handler without causing thread errors?

To update animation state from gesture handlers without thread errors, define your callback function with useCallback and schedule it on the appropriate thread using scheduleOnRN or scheduleOnUI, coordinating updates safely within the animation pipeline.

Do I need the worklet directive when using scheduleOnRN for cross-thread calls?

You do not need the worklet directive when using scheduleOnRN. The Skill recommends avoiding unnecessary worklet directives and preferring automatic conversion when scheduling functions between the JavaScript and UI threads.

Can I use useAnimatedReaction to coordinate cross-thread updates in React Native?

Yes, you can use useAnimatedReaction to coordinate cross-thread updates. Combine it with scheduleOnRN or scheduleOnUI and stable useCallback function references to safely manage animation state and gesture-driven interactions across threads.