Repository navigation
fix(record): silence Reanimated's ".value inside inline style" warning - #30
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
processInlineStylesWarninginreact-native-worklets/plugin) rewrites everyx.valueinside an inlinestyleobject into aconsole.warn, on any component.src/app/record.tsxhad{ fontSize: since.value }. Theresinceis the plain object thatsinceTimerFonts()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
sinceLabelFontandsinceValueFont. The values and styles are the same, so the layout does not change.How it was tested
tests/inlineStyleWarning.test.tscompiles everysrc/**/*.tsxfile with the project'sbabel.config.jsand fails if the warning is injected. A positive control compiles the old pattern, so the test cannot pass just because the plugin stopped running.origin/main'srecord.tsxinjects the warning 1 time; this branch injects it 0 times.npx jestpasses 263/263;npm run typecheckandnpm run lintare clean.🤖 Generated with Claude Code