visgl / react-map-gl

React friendly API wrapper around MapboxGL JS
http://visgl.github.io/react-map-gl/
Other
7.88k stars 1.36k forks source link

[Bug] React 19: "Warning: Invalid prop `source` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props." #2410

Open tordans opened 4 months ago

tordans commented 4 months ago

Description

I am testing ReactMapGL in React 19 with React Compiler and Next JS 15. I am getting this warning with ReactMapGL and Tailwind HeadlessUI about Fragments and Props.

This might be something temporary in one of the canary releases … And I am not sure it it comes from React 19 (Probably), Next JS or the Compiler.

Warning: Invalid prop `source` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.
    at Source (webpack-internal:///(app-pages-browser)/./node_modules/react-map-gl/dist/esm/components/source.js:76:64)
    at SourcesLayersAtlasGeoMemoized (webpack-internal:///(app-pages-browser)/./src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/SourcesLayersAtlasGeo.tsx:46:13)
    at SourcesLayersAtlasGeo (webpack-internal:///(app-pages-browser)/./src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/SourcesLayersAtlasGeo.tsx:172:72)
    at div
    at div
    at Map (webpack-internal:///(app-pages-browser)/./node_modules/react-map-gl/dist/esm/exports-maplibre.js:52:71)
    at Map (webpack-internal:///(app-pages-browser)/./src/app/regionen/[regionSlug]/_components/Map/Map.tsx:56:143)
    at div
    at MapProvider (webpack-internal:///(app-pages-browser)/./node_modules/react-map-gl/dist/esm/components/use-map.js:15:74)
    at MapInterface (webpack-internal:///(app-pages-browser)/./src/app/regionen/[regionSlug]/_components/MapInterface.tsx:42:72)
    at ShowRegionPage (Server)

Expected Behavior

No response

Steps to Reproduce

-

Environment

Logs

No response