visgl / visgl/react-map-gl

viewState `padding` expected to be optional

Open
#2,133 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
8.5k
Forks
1.4k
Avg merge
5d 17h
Merged PRs (30d)
3

Description

Currently I'm experiencing a Property 'padding' is missing in type ... but required in type 'ViewState'. error. I'd expect this type to be optional based on this implementation:
https://github.com/visgl/react-map-gl/blob/109c334bdffaa5b2016c50bf6aaa119ce56082ce/src/mapbox/mapbox.ts#L544-L546

I believe the issue is in this type definition, which should define padding as optional.

https://github.com/visgl/react-map-gl/blob/109c334bdffaa5b2016c50bf6aaa119ce56082ce/src/types/external.ts#L30

I can open a PR to fix this if it should be optional.

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 comparing the ViewState definition in src/types/external.ts with the implementation around src/mapbox/mapbox.ts:544-546. Confirm that the implementation permits missing padding, then update the type so it matches that behavior; the issue is done when the reported TypeScript error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.