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

Braking issue with new library upgrade #62222

Open
felo91 opened this issue Sep 12, 2022 · 4 comments
Open

Braking issue with new library upgrade #62222

felo91 opened this issue Sep 12, 2022 · 4 comments

Comments

@felo91
Copy link

felo91 commented Sep 12, 2022

When I made an update of the the library my code breaks

TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type '{ map: google.maps.Map | undefined; }' is not assignable to parameter of type 'Partial<unknown> & Attributes'.
      Object literal may only specify known properties, and 'map' does not exist in type 'Partial<unknown> & Attributes'.
    60 |                        {React.Children.map(children, (child) => {
    61 |                                if (React.isValidElement(child)) {
  > 62 |                                        return React.cloneElement(child, { map });
       |                                                                           ^^^
    63 |                                }
    64 |                        })}
    65 |                </>

This didn't happen in previous versions and my code is copy paste from google example here

@elitenoire
Copy link

I had this problem too, but was able to fix it using
return React.cloneElement(child as React.ReactElement, { map });

@msnisha
Copy link

msnisha commented Dec 21, 2022

@elitenoire Thank you for the pointer.
I am having similar issue and unable to fix it. Do you have any working example with complete code in public repository?

@max10rogerio
Copy link

max10rogerio commented Mar 1, 2023

If you're running on React 18, try this:

"resolutions": {
    "@types/react": "^18.0.28"
  },

and run install to fix

yarn install

ref:

#59765

@mihaiicey
Copy link

I had this problem too, but was able to fix it using return React.cloneElement(child as React.ReactElement, { map });

thanks. worked for me :D

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

No branches or pull requests

5 participants