reearth / resium

React components for 🌏 Cesium
https://resium.reearth.io
MIT License
698 stars 130 forks source link

The map does not appear in version 1.17.3 #660

Open dittrand opened 2 months ago

dittrand commented 2 months ago

I'm trying to create a project in React that when the "Open Map" button is clicked, the map appears, In version 1.17.2 the map appears twice, In version 1.17.3 the map no longer appears,

My component is: import { useState } from 'react' import { Viewer } from 'resium'

export const CesiumMap = () => { const [open, setOpen] = useState(false); return ( <> <button onClick={() => setOpen(!open)}> Open Map {open && } </> ) }

package.json: "dependencies": { "@craco/craco": "^7.1.0", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "@types/jest": "^27.5.2", "@types/node": "^16.18.97", "@types/react": "^18.3.1", "@types/react-dom": "^18.3.0", "cesium": "1.116.0", "craco-cesium": "^1.2.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-scripts": "5.0.1", "resium": "1.17.2", "typescript": "^4.9.5", "web-vitals": "^2.1.4" }, "scripts": { "start": "craco start", "build": "craco build", "test": "craco test", "eject": "react-scripts eject" },

Waiting for an answer

Kai-W commented 1 month ago

i had a similar problem and made an example https://codesandbox.io/p/devbox/funny-mahavira-tryfy9