[Bug]: changing centerCoordinate prop doesn't move camera when screen is not focused
Open
Nobody has claimed this yet.
bug 🪲
- Dominant language
- Kotlin
- Stars
- 2.9k
- Forks
- 947
- Avg merge
- 6d 37m
- Merged PRs (30d)
- 1
Description
Mapbox Version
default
React Native Version
0.83.6
Platform
iOS
@rnmapbox/maps version
10.3.0
Standalone component to reproduce
import React, { Camera, MapView } from "@rnmapbox/maps";
import { useEffect, useState } from "react";
const BugReportExample = () => {
// context
const [centerCoordinates, setCenterCoordinates] = useState([
-74.00597, 40.71427,
]);
// update on other screen
useEffect(() => {
setTimeout(() => {
setCenterCoordinates([51.5074, -0.1278]);
}, 1000);
});
return (
<MapView>
<Camera centerCoordinate={centerCoordinates} />
</MapView>
);
};
Observed behavior and steps to reproduce
In a tabs layout when centerCoordinate prop on Camera component changes the Camera doesn't move to the updated center coordinates
Expected behavior
the camera should move to the updated center coordinates
Notes / preliminary analysis
No response
Additional links and references
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the standalone BugReportExample and reproduce the issue in an iOS tabs layout using @rnmapbox/maps 10.3.0. Trace how Camera receives centerCoordinate changes while its screen is unfocused. Done means changing the prop moves the camera to the updated coordinates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100