expo / react-native-action-sheet

A cross-platform ActionSheet for React Native
MIT License
1.37k stars 224 forks source link

Stabilize the identity of the Provider value #251

Closed jbaudanza closed 2 years ago

jbaudanza commented 2 years ago

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.

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 3.13.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: