Need to deprecated enums
used for component prop typing
#286
Labels
bug
Something isn't working
package:react
Issues/PRs related to the `@oxygen-ui/react` package.
typescript
Issues related to typings
Describe the issue:
The use of
enums
for prop typing is causing type mismatches in TypeScript, particularly when passing string values to props that expect enum values. This results in errors when using the component, such as:How to reproduce:
variant
inIconButton
)."contained"
or"text"
) to the prop.Example:
Expected behavior:
The component should allow passing strings directly for props like
variant
, instead of requiring the enum, to improve flexibility and ease of use.Proposed Solution:
Move away from using
enums
for prop typing and switch to string literal unions, which allows using string values directly.Example:
This will allow the following usage without causing type errors:
Additional context:
The text was updated successfully, but these errors were encountered: