Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add onPressIn & onPressOut props to Text (#31288)
Summary: I added onPressIn & onPressOut props to Text to help implement custom highlighting logic (e.g. when clicking on a Text segment). Since TouchableOpacity can't be nested in Text having custom lineHeights without bugs in some occasions, this modification helps to replicate its behavior. ## Changelog [General] [Added] - Add onPressIn & onPressOut props to Text Pull Request resolved: #31288 Test Plan: ``` const [pressing, setPressing] = useState(false); <Text onPressIn={() => setPressing(true)} onPressOut={() => setPressing(false)} style={{ opacity: pressing ? 0.5 : 1 }} /> ``` Thanks in advance! Reviewed By: yungsters Differential Revision: D27945133 Pulled By: appden fbshipit-source-id: 8342ca5f75986b4644a193d2f71eab3bc0ef1a5f
- Loading branch information