[X] I agree to follow this project's Code of Conduct
Question
Hey there, I am using a `select` for my portable text content block and am running into issues, when trying to type `default`.
const unsupportedTypeBlockSelection = {
_key: q.string(),
_type: ['"unsupported"', q.literal('unsupported')],
unsupportedType: ['_type', q.string()],
};
export type UnsupportedBlockType = TypeFromSelection<
typeof unsupportedTypeBlockSelection
>;
I've been getting an error for typing the unsupported type:
Type '(string | ZodLiteral<"unsupported">)[]' is not assignable to type '[string, ZodType<any, ZodTypeDef, any>]'.
Target requires 2 element(s) but source may have fewer.ts(2344)
My goal is to have a strict type in my SanityContent component
Is there an existing issue for this?
Code of Conduct
Question
I've been getting an error for typing the
unsupported
type:My goal is to have a strict type in my SanityContent component
I can of course get around this by using
TypedObject
from@portabletext/types
but that defies the point of strongly typing.