Skip to content

border-s-* and border-e-* compile to style props React Native does not support #378

Description

@danstepanov

Split out from nativewind/nativewind#1737, which was reported against v4 with a narrower symptom. The v5 version is broader.

All logical border utilities are silent no-ops on native. The compiler maps border-inline-start-color to borderInlineStartColor, and border-s-1 produces borderInlineStartWidth and borderInlineStartStyle. None of these props exist in React Native. RN 0.81 ships logical inline props only for margin, padding, and inset. For borders it has borderStartColor, borderEndColor, borderStartWidth, and borderEndWidth, which are RTL aware. Unknown style keys get dropped by the view config filter, so nothing renders and nothing warns.

Verified by compiling .x { border-inline-start-color: red; } through the current compiler, which emits borderInlineStartColor, and by checking RN 0.81 view configs for the supported prop names. There is no remapping in the runtime either.

Fix should go in the declaration parsers in src/compiler/declarations.ts (the border-inline-* entries around lines 120 to 131): emit border-start-color, border-end-color, border-start-width, and border-end-width so they camelCase to the real RN logical props. Border style has no per-side RN equivalent, so the inline style declarations should fold into borderStyle or be dropped.

Note the existing tests in src/__tests__/vendor/tailwind/borders.test.tsx currently assert the invalid names (border-s-1 expects borderInlineStartWidth: 1), so they pass while the behavior is broken. Expectations need to change with the fix.

The v4 issue is narrower and separate: only var() based custom colors fail there, because unparsedPropertyMapping in react-native-css-interop lacks the border inline entries that the parsed path has. That fix stays in the v4 branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-triagedIssue has been automatically triaged by the auto-triage workflowbugSomething isn't workingconfirmedBug reproduced and confirmed by triagedeferred (post-5.0)Not required for the 5.0 latest release; revisit after

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions