Skip to content
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

[Bug] Missing typings for React DeckGL children set to a render callback #8108

Closed
1 of 7 tasks
mz8i opened this issue Sep 12, 2023 · 1 comment
Closed
1 of 7 tasks
Labels

Comments

@mz8i
Copy link
Contributor

mz8i commented Sep 12, 2023

Description

The following simple setup

<DeckGL>
    {({viewState, width, height}) => (<>
      <Map viewState={viewState} width={width} height={height} />
    </>)}
  </DeckGL>

produces a TypeScript error:

Type '({ viewState, width, height }: { viewState: any; width: any; height: any; }) => Element' is not assignable to type 'ReactNode'.

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

Passing a render callback as the React component's children is allowed and documented for JavaScript, so should be supported in TypeScript.

Steps to Reproduce

<DeckGL>
    {({viewState, width, height}) => (<>
      <Map viewState={viewState} width={width} height={height} />
    </>)}
  </DeckGL>

Environment

  • Framework version: 8.9.26
  • Browser: N/A
  • OS: N/A

Logs

No response

@Pessimistress
Copy link
Collaborator

Fix published in v8.9.28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants