Skip to content

Strict API: fix transformOrigin so ThemeStyles infers #101813

Closed

Description

@roryabraham

Part of #101439.

Do not enable customConditions here. This has to typecheck on the current config.

Incompatibility

ThemeStyles is ReturnType<typeof styles>, and styles() ends in satisfies Styles (src/styles/index.ts). Styles requires every value to be ViewStyle | TextStyle | ….

Two style objects set transformOrigin to a string:

  • src/styles/index.ts — transformOrigin: 'left center'
  • src/styles/utils/index.ts — transformOrigin: 'top left'

Under the Strict API transformOrigin is string | [string | number, string | number, string | number], and our ViewStyle annotation infers it as number. The satisfies check fails, inference keeps only the keys that still check, and ThemeStyles collapses. Every styles.flex1 access in the app then errors — 2312 errors across 325 files, all from this.

Fix

Type those two objects so the string form is accepted (TextStyle, or a small local intersection). Do not widen Styles.

Confirm by probing styles(theme).flex1 — it should resolve again. The 325 call sites need no changes.

Activity

  1. self-assigned this
    on Sep 21, 2026
  2. roryabraham commented on Sep 22, 2026

    @roryabraham
    ContributorAuthor

    optimistically closing this as no payments are due and it's unlikely the types-only PR will be reverted

  3. melvin-bot commented on Sep 24, 2026

    @melvin-bot

    @roryabraham

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.92-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions