Suddenly, we got a type error linked with the Select component from Plasmic
Error: src/components/plasmic/SelectBase.tsx(15,65): error TS2345: Argument of type 'SelectBaseProps' is not assignable to parameter of type 'BaseSelectProps'.
Types of property 'onChange' are incompatible.
Type '((value: string) => void) | undefined' is not assignable to type '((value: string | null) => void) | undefined'.
Type '(value: string) => void' is not assignable to type '(value: string | null) => void'.
Types of parameters 'value' and 'value' are incompatible.
Type 'string | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.
Hi @fmota, thanks for your message. Is there something we can do about it, because right now the file gets generated automatically with plasmic codegen from our github action pipeline, so it’s not something that we can control?
Even with that, I don’t think we should be overwriting this file, this should be a skeleton that you are free to edit, only the files with names in format Plasmic* should be getting touched
@fmota Yes makes sense that, that’s why I wanted edit the file to surpass the ts error
const SelectBase_ = (props: SelectBaseProps, ref: SelectRef) => {
// @ts-expect-error: Error: src/components/plasmic/SelectBase.tsx(15,65): error TS2345: Argument of type 'SelectBaseProps' is not assignable to parameter of type 'BaseSelectProps'. Types of property 'onChange' are incompatible.
const { plasmicProps, state } = PlasmicSelectBase.useBehavior(props, ref)
return <PlasmicSelectBase {...plasmicProps} />
}
to surpass the error, but for some reason the build from github action pipeline still fails, while locally the build works
Even with that, I don’t think we should be overwriting this file, this should be a skeleton that you are free to edit, only the files with names in format Plasmic* should be getting touched
Maybe a problem here?
We have that problem as well, but in Select.tsx not SelectBase:
./components/Select.tsx:15:61
Type error: Argument of type 'SelectProps' is not assignable to parameter of type 'BaseSelectProps'.
Types of property 'onChange' are incompatible.
Type '((value: string) => void) | undefined' is not assignable to type '((value: string | null) => void) | undefined'.
Type '(value: string) => void' is not assignable to type '(value: string | null) => void'.
Types of parameters 'value' and 'value' are incompatible.
Type 'string | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.
13 | }
14 | function Select_(props: SelectProps, ref: SelectRef) {
> 15 | const { plasmicProps, state } = PlasmicSelect.useBehavior(props, ref);
| ^
16 | return <PlasmicSelect {...plasmicProps} />;
17 | }
18 |