I have a React project with typescript, using the package with version "google-map-react": "2.2.1" and "@types/google-map-react": "~2.1.10" and the following warning appears and error

The version of react is 18.2.0
How could I solve this error? thank you