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.
Currently, the Object that is passed into the
value
prop of the provider is generated on each render. This causes each subscriber ofuseActionSheet
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.