rnmapbox / rnmapbox/maps

[Bug]: The `CameraPadding` lists all edges as being required even though the code allows them to be optional

Open
#3,599 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug 🪲
Dominant language
Kotlin
Stars
2.9k
Forks
947
Avg merge
6d 37m
Merged PRs (30d)
1

Description

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.73.9

Platform

iOS, Android

@rnmapbox/maps version

10.1.30

Standalone component to reproduce
import React from "react";
import { MapView, Camera } from "@rnmapbox/maps";

const aLine = {
  type: "LineString",
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

const BugReportExample: React.FC = () => {
  return (
    <MapView style={{ flex: 1 }}>
      <Camera padding={{ paddingBottom: 10 }} />
    </MapView>
  );
};

Observed behavior and steps to reproduce

The typescript build fails because the CameraPadding type requires all four padding directions to be specified.

Expected behavior

The build should pass with only the padding directions I actually want to override.

Notes / preliminary analysis

No response

Additional links and references

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the CameraPadding type used by the Camera component and inspect the TypeScript declarations or source that define its four edge properties. Run the TypeScript build with the provided example, then verify that specifying only paddingBottom compiles while the existing Camera padding behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.