react-compiler-reanimated-shared-values — Claude Code rule: setup
react-compiler-reanimated-shared-values is a Claude Code rule for handling Reanimated shared values with React Compiler enabled. It directs code to use .get() and .set() rather than .value.
AGPL-3.0 ★ 88 updated 2026-11-17
.claude/rules/react-compiler-reanimated-shared-values.mdWhat react-compiler-reanimated-shared-values does
The rule requires .get() to read a Reanimated shared value and .set() to update it when React Compiler is enabled. A counter can update with count.set(count.get() + 1) and render its value with count.get().
React Compiler cannot track direct .value property access, so the rule avoids that pattern. To install it in Claude Code, place the file at .claude/rules/react-compiler-reanimated-shared-values.md.
What it helps with
- replace direct
.valuereads with.get() - update Reanimated shared values through
.set() - use Reanimated shared values with React Compiler enabled
Example prompts for the agent
- Use
.get()and.set()for Reanimated shared values in this component. - Update the
countexample to use Reanimated methods with React Compiler.
How to install react-compiler-reanimated-shared-values
Manually: put the files in place
.claude/rules/react-compiler-reanimated-shared-values.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/react-compiler-reanimated-shared-values.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/react-compiler-reanimated-shared-values.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/react-compiler-reanimated-shared-values.mdManually: put the files in place
.clinerules/react-compiler-reanimated-shared-values.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about react-compiler-reanimated-shared-values
How do I install react-compiler-reanimated-shared-values in Claude Code?
Place the rule file at .claude/rules/react-compiler-reanimated-shared-values.md. Claude Code reads rules from that directory.
What does react-compiler-reanimated-shared-values do?
It directs code to access Reanimated shared values through .get() and .set() instead of using .value directly.
How should Reanimated shared values be accessed with React Compiler enabled?
Read them with .get() and update them with .set(). The compiler cannot track direct .value property access.