Skip to content

fix(web): handle empty styles without invalidating the style memo - #764

Open
OskarEichler wants to merge 2 commits into
appandflow:mainfrom
OskarEichler:codex/web-empty-style
Open

fix(web): handle empty styles without invalidating the style memo#764
OskarEichler wants to merge 2 commits into
appandflow:mainfrom
OskarEichler:codex/web-empty-style

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 27, 2026

Copy link
Copy Markdown

Summary

Fix web SafeAreaView crashes for valid style={null} and style={false} values. Flatten to an empty object only inside the memo, and remove the per-render {} default that defeats memo reuse when style is omitted.

No API or native behavior changes. Existing numeric padding/margin and edge modes are preserved; null/false styles now behave like an omitted style.

Test Plan

  • React Native 0.87.1 consumer: immutable install and lint, all 13 web production targets, all four browser-extension builds, and all four production-mode Metro bundles pass. 172 installed source/native/artifact files match the verified fork. Native implementation is unchanged; both products' Android/iOS Debug builds passed immediately before this JS-only batch.

  • Existing Jest suite: 21 tests / four suites / 11 snapshots pass, before and after.

  • TypeScript, ESLint (three existing deep-import warnings), targeted Prettier, CJS/ESM/declaration builds and whitespace checks pass.

  • Inline actual-component React/DOM checks: 14 style cases across padding and margin improve from four failures to zero. Ten rerenders without a style prop perform ten style calculations on baseline and one after the fix.

  • React Doctor changed scope improves from 83 to 86 after removing the default-object allocation. The remaining fallback-provider effect warning is the intentional window-measurement notification contract, not suppressed.

  • No test/spec files changed; no claim of physical-device/visual end-to-end coverage.

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