Commit 9fbf820
committed
Allow outline* styles on stable React Native
Closes #467
## Root cause
The `outlineColor`/`outlineOffset`/`outlineStyle`/`outlineWidth` keys were gated behind `version.experimental` in `isAllowedStyleKey.js` (and `outlineOffset`/`outlineWidth` in `isLengthStyleKey.js`). Any style key not in the allow-list is silently dropped, so these props never reached React Native on a published release.
`version.experimental` is **not** a user-facing flag. It is derived from the RN version at runtime
https://github.com/facebook/react-strict-dom/blob/c4e69e0fa486ba8df835a2e3f396206070c17153/packages/react-strict-dom/src/native/modules/version.js#L13-L20
It is `true` **only** on HEAD/nightly builds and `false` on every published RN release (e.g. 0.84.0). So the documented `outline*` support was unreachable for normal apps, with no way to opt in.
## Why it was a stale gate
The `outline*` keys were originally added alongside `boxShadow`, `filter`, and `mixBlendMode` in the same experimental block. Those three were later graduated into the always-allowed set; the four `outline*` keys were left behind by oversight. RN has supported `outline*` since 0.77, and RSD's minimum is `react-native >=0.82.0`, so the props are safe to allow unconditionally for every supported version.
## Why tests didn't catch it
The test suite mocks the RN version as `major: 1000` (`tests/__mocks__/react-native/index.js`), which forces `experimental === true`. The existing `outline*` test therefore passed in CI while the same code dropped the props for users on stable RN.
## The fix
Graduated the keys out of the experimental gate (same treatment already given to `boxShadow`/`filter`/`mixBlendMode`):
- `isAllowedStyleKey.js` — moved `outlineColor`, `outlineOffset`, `outlineStyle`, `outlineWidth` into the main allow-list; removed the now-empty `if (version.experimental)` block and its unused `version` import.
- `isLengthStyleKey.js` — moved `outlineOffset`, `outlineWidth` into the main length-key set; removed the experimental block and unused import.
## Result
`outline*` now resolves on all supported RN versions, the documentation becomes accurate with no changes, the existing test now exercises the real (non-experimental) path, Flow passes, and the full CSS suite (141 tests) is green.1 parent c4e69e0 commit 9fbf820
2 files changed
Lines changed: 6 additions & 16 deletions
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| |||
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| |||
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | 172 | | |
178 | 173 | | |
179 | 174 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| |||
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
0 commit comments