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
When assigning common component props like "className" to Slider:
<Slider className="some-class" ... />
, compiler would yield :
TS2339: Property 'className' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<BasicProps, ComponentState>> & Readonly<...'.
What is expected?
By assigning props like "id" or "className", there shouldn't be any TS2339 error.
What is actually happening?
Take Slider for example but there're more components which have similar issue.
Version
2.13.0
Environment
mac os, chrome
Reproduction link
https://github.com/ant-design/ant-design/blob/master/components/slider/index.tsx
Steps to reproduce
When assigning common component props like "className" to
Slider
:, compiler would yield :
TS2339: Property 'className' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<BasicProps, ComponentState>> & Readonly<...'.
What is expected?
By assigning props like "id" or "className", there shouldn't be any TS2339 error.
What is actually happening?
Take
Slider
for example but there're more components which have similar issue.in
antd/lib/slider/index.d.ts
:The props interface should either extend React.HTMLAttributes or have a
[props: string]: any
, cause clearly in code it supports native/custom props:The text was updated successfully, but these errors were encountered: