Files
react-native/packages
Samuel Susla 220d8a51cc fix TouchableWithoutFeedback and TouchableOpacity dropping onPress in React 18 (#42121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42121

## Changelog:
[General][Fixed] - TouchableWithoutFeedback and TouchableOpacity dropping touches with React 18.

TouchableWithoutFeedback and TouchableOpacity do not trigger onPress when used with React 18. This is because it resets its pressability configuration in `componentWillUnmount`. This is fine, we want to stop deliver events and restart all timers when component is unmounted.
```
componentWillUnmount(): void {
    this.state.pressability.reset();
  }
```

But TouchableWithoutFeedback and TouchableOpacity were not restarting the pressability configuration when component was mounted again. It was restarting the configuration in `componentDidUpdate`, which is not called when component is unmounted and mounted again.

Reviewed By: fkgozali

Differential Revision: D52388699

fbshipit-source-id: ef13194c6581c5d31d0f1cb465bfd0cf98d672ea
2024-01-25 14:19:03 +00:00
..
2023-09-26 10:27:39 -04:00
2024-01-19 13:43:08 +00:00
2023-12-14 13:46:03 +00:00
2024-01-08 11:08:47 +00:00
2024-01-08 11:08:47 +00:00
2024-01-08 11:08:47 +00:00
2023-09-27 12:36:19 -04:00
2023-09-26 10:27:39 -04:00
2023-12-14 13:46:03 +00:00