[Doc]HexagonLayer: TypeScript example cannot be compiled
Open
Nobody has claimed this yet.
doc
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Link
https://deck.gl/docs/api-reference/aggregation-layers/hexagon-layer
Description
The line
getTooltip: ({object}: PickingInfo<BikeRack>) => object && `Count: ${object.elevationValue}`,
in the TypeScript example cannot be compiled. The error the compiler issues is:
Type '({ object }: HexagonLayerPickingInfo<BikeRack>) => string | undefined' is not assignable to type '(info: { color: Uint8Array<ArrayBufferLike> | null; layer: Layer<{}> | null; sourceLayer?: Layer<{}> | null | undefined; viewport?: Viewport | undefined; ... 8 more ...; pixelRatio: number; }) => TooltipContent'.
Type 'string | undefined' is not assignable to type 'TooltipContent'.
Type 'undefined' is not assignable to type 'TooltipContent'.ts(2322)
(using typescript 5.7.3)
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
Open the HexagonLayer documentation page and inspect the TypeScript example containing the getTooltip callback. Compile the example with TypeScript 5.7.3, then adjust the documented example so it compiles without the reported type error and verify the error is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100