You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to inject some custom props into a styled component. The following code actually does what I want at runtime, but it is wrong according to typescript.
constFooComponent=styled('div')<{foo: string}>(({ props })=>({// this is wrong according to Typescript'--foo': props.foo,}));// later... (this is also wrong according to Typescript)<FooComponentfoo="bar">
The typescript errors are long and cryptic, and I've spent hours now looking at the underlying types without success. What type parameters do I have to provide for the code below to actually be accepted by typescript?
I'd like to inject some custom props into a
styled
component. The following code actually does what I want at runtime, but it is wrong according to typescript.The typescript errors are long and cryptic, and I've spent hours now looking at the underlying types without success. What type parameters do I have to provide for the code below to actually be accepted by typescript?
Stackblitz: https://stackblitz.com/edit/angular-7c4vrj-bzayuw?file=app.tsx
The text was updated successfully, but these errors were encountered: