Skip to content

Conversation

@jbaudanza
Copy link
Contributor

Currently, the Object that is passed into the value prop of the provider is generated on each render. This causes each subscriber of useActionSheet to re-render, unnecessarily.

This can also cause issues for any dependency arrays or PureComponents that are including showActionSheetWithOptions.

This PR will stabilize the identity of the value, so it won't change.

I'm not sure if the getContext function is necessary. I kept it in there in case it's being used somewhere that I can't see.

@bradbyte bradbyte self-assigned this Nov 29, 2021
@bradbyte bradbyte merged commit 55005ba into expo:master Jan 10, 2022
github-actions bot pushed a commit that referenced this pull request Jan 10, 2022
# [3.13.0](v3.12.0...v3.13.0) (2022-01-10)

### Bug Fixes

* defer calling onSelect until after animation ([#248](#248)) ([1fb3411](1fb3411)), closes [#203](#203)
* stabilize the identity of the context provider value ([#251](#251)) ([55005ba](55005ba))

### Features

* support closing actionsheet with Esc key on web ([#247](#247)) ([c4c3f8b](c4c3f8b)), closes [#194](#194)
@github-actions
Copy link
Contributor

🎉 This PR is included in version 3.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

robertomartinez09515 added a commit to robertomartinez09515/action-sheet-react-best-proj that referenced this pull request Jul 25, 2022
# [3.13.0](expo/react-native-action-sheet@v3.12.0...v3.13.0) (2022-01-10)

### Bug Fixes

* defer calling onSelect until after animation ([#248](expo/react-native-action-sheet#248)) ([1fb3411](expo/react-native-action-sheet@1fb3411)), closes [#203](expo/react-native-action-sheet#203)
* stabilize the identity of the context provider value ([#251](expo/react-native-action-sheet#251)) ([55005ba](expo/react-native-action-sheet@55005ba))

### Features

* support closing actionsheet with Esc key on web ([#247](expo/react-native-action-sheet#247)) ([c4c3f8b](expo/react-native-action-sheet@c4c3f8b)), closes [#194](expo/react-native-action-sheet#194)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants