Home > database >  how to remove type checking error in typescript react?
how to remove type checking error in typescript react?

Time:12-26

I am getting below error . can you please help me to resolve below error. I am using react typescript Material UI . I am trying to customise button using below link enter image description here

  Type '"contained" | "outlined" | "text" | "error"' is not assignable to type '"contained" | "outlined" | "text" | undefined'.
          Type '"error"' is not assignable to type '"contained" | "outlined" | "text" | undefined'.ts(2322)

CodePudding user response:

variant props accepts only values from '"contained" | "outlined" | "text" | undefined'.

remove error: "error" from your ButtonVariantsMapper and it should work fine.

  • Related