Closed PSalaun closed 3 years ago
Thanks for reporting this bug! This was a recently introduced feature and it looks like this only occurs when explicitly typing the image param. I've just released 3.1.5 with a fix, please let me know if this solves your issue!
Hello,
I'm creating a component that may or may not receive an image from Sanity, so the image type is "string | null". However TS is not happy with it (using version 3.1.4), as I get
Argument of type 'string | null' is not assignable to parameter of type 'null'. Type 'string' is not assignable to type 'null'.
when passing the image touseNextSanityImage
. It does the same if I replace string by SanityImageSource.As the hook can handle null images, it should be ok to pass this argument, shouldn't it?