-
-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add allowUpdates prop on Camera #1619
Conversation
@ferdicus What do you think about this? We've been working around this for a pretty long time, and I think this would greatly simplify how an app needs to handle this situation. I know this prop doesn't have a corresponding config in the native modules, but it is specific to React logic (e.g. you can't "early return" in declarative code). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, optional after all 👍🏿
Do you have an example of how/ when you're using this?
Yep, we do:
(The picture-in-picture conditional is for Android.) |
thanks |
@naftalibeder, this is failing tests after merge (sorry, didn't catch it earlier - forked PRs don't run actions 😞 ): |
Sorry about that - fixed here. Maybe the default PR checklist should include |
Description
Adds an optional
allowUpdates
boolean prop toCamera
which, if false, causes the camera to return early before communicating with the native camera module.This is intended for situations where the map is not visible (including if the app is in the background), and it would be preferable to avoid moving the camera - and therefore fetching new tiles, or causing the markers on the map to change - without actually hiding the map, which can cause undesirable behavior when the map reappears.
The only reasonable alternative is to "freeze" all props before sending them to
Camera
, which adds a bit more complicated logic to the enclosing app.Checklist
yarn lint
yarn generate
CHANGELOG.md
index.d.ts
)/example
)Screenshot OR Video
TODO