Skip to content

Commit 8745a75

Browse files
Remove incorrect underlayColor requirement from TouchableHighlight activeOpacity docs
## Summary: The `activeOpacity` prop doc on `TouchableHighlight` says it "Requires `underlayColor` to be set", but the component does not need that. `_createExtraStyles()` applies `this.props.activeOpacity ?? 0.85` to the child unconditionally (`packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js:165`), and an unset `underlayColor` falls back to `'black'` (`:168-170`), so `activeOpacity` works with or without an explicit `underlayColor`. This removes the incorrect sentence; nothing else changes. ## Changelog: [GENERAL] [FIXED] - Remove incorrect underlayColor requirement from TouchableHighlight activeOpacity docs ## Test Plan: Docs-only change to a prop comment. - `yarn build-types` and `yarn test-generated-typescript` pass; the generated declarations carry the corrected comment and the committed API snapshot is unchanged. - `yarn prettier --check` and `yarn eslint --max-warnings 0` on `TouchableHighlight.js` pass, and `git diff --check` is clean. - No other comment or doc in the repo states the same requirement (`rg` for it returned nothing). Prepared with AI assistance (Claude Code) and reviewed with GitHub Copilot. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Differential Revision: D130876771 Pull Request resolved: #59901
1 parent 31de0e6 commit 8745a75

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type AndroidProps = Readonly<{
3636

3737
type TouchableHighlightBaseProps = Readonly<{
3838
/**
39-
* Opacity of the wrapped view when touch is active. Requires `underlayColor` to be set.
39+
* Opacity of the wrapped view when touch is active.
4040
*
4141
* @default `0.85`
4242
*/

0 commit comments

Comments
 (0)