Open cmoulliard opened 5 months ago
Can you try converting the template string to CSS object?
converting the template string
Which template string ?
onst Tag: ComponentClass = styled(({ label, onDelete, ...props }) => (
<div {...props}>
<span>{label}</span>
<CloseIcon onClick={onDelete} />
</div>
))`...` << template string
try this:
onst Tag: ComponentClass = styled(({ label, onDelete, ...props }) => (
<div {...props}>
<span>{label}</span>
<CloseIcon onClick={onDelete} />
</div>
))({
display: "flex",
alignItems: "center",
height: "24px",
margin: "2px",
lineHeight: "22px",
backgroundColor: "#fafafa",
border: "1px solid #e8e8e8",
borderRadius: "2px",
boxSizing: "content-box",
padding: "0 4px 0 10px",
outline: "0",
overflow: "hidden",
"&:focus": { borderColor: "#40a9ff", backgroundColor: "#e6f7ff" },
"& span": {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis"
},
"& svg": { fontSize: "12px", cursor: "pointer", padding: "4px" }
})
Steps to reproduce
Steps:
Current behavior
The following code (see here)
generates this error when we execute
yarn tsc
using such versions of material-ui:
Expected behavior
No error should be reported
Context
I try to publish my project as npmjs.org module and it is needed to run "yarn tsc" in that case. This is how I got this error that we don't have when the plugin is used directly locally in backstage.
Your environment
and typeconfig.json
Search keywords: TS2345, typescript, not assignable to parameter of type