Skip to content

fix(record): silence Reanimated's ".value inside inline style" warning - #30

Merged
dsatpm merged 1 commit into
mainfrom
dsatpm/since-font-warning-80e04f4d
Oct 10, 2026
Merged

dsatpm merged 1 commit into
mainfrom
dsatpm/since-font-warning-80e04f4d

Conversation

@dsatpm

@dsatpm dsatpm commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Fixes the dev-build warning: "It looks like you might be using shared value's .value inside reanimated inline style."

Cause

In development builds, the worklets Babel plugin (processInlineStylesWarning in react-native-worklets/plugin) rewrites every x.value inside an inline style object into a console.warn, on any component. src/app/record.tsx had { fontSize: since.value }. There since is the plain object that sinceTimerFonts() returns, not a shared value, so the warning was a false positive that fired on every render of the recording screen.

Fix

The two font sizes are destructured into sinceLabelFont and sinceValueFont. The values and styles are the same, so the layout does not change.

How it was tested

  • New tests/inlineStyleWarning.test.ts compiles every src/**/*.tsx file with the project's babel.config.js and fails if the warning is injected. A positive control compiles the old pattern, so the test cannot pass just because the plugin stopped running.
  • Compiling origin/main's record.tsx injects the warning 1 time; this branch injects it 0 times.
  • npx jest passes 263/263; npm run typecheck and npm run lint are clean.

🤖 Generated with Claude Code

In development builds the worklets Babel plugin rewrites any `x.value` in an
inline style object into a console.warn about shared values. record.tsx had
`{ fontSize: since.value }`, where `since` is the plain object returned by
sinceTimerFonts(), so every render of the recording screen warned. The font
sizes are now destructured into sinceLabelFont / sinceValueFont. No layout
change: same numbers, same styles.

tests/inlineStyleWarning.test.ts compiles every src/**/*.tsx with the
project's babel.config.js and fails if the plugin injects the warning, with a
positive control on the old pattern so it cannot pass vacuously. Compiling
origin/main's record.tsx injects the warning once; this branch injects none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dsatpm
dsatpm merged commit 603cc4d into main Oct 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant