how can I set the icon size as percentage in TS? #1450
-
Previously with just javascript it wasn't an issue at all setting the size like this:
But now I'm migrating my app to typescript and the compiler says about the size attribute that I tried removing completely the size attribute and adding the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @GhostOrder28! I think we typically expect icons to be sized in units (i.e. a Lines 3183 to 3187 in 10e8e23 If you have a specific use-case for a percentage or string-based value (and it was working as you expected), it should still work by casting it:
As for setting the class names directly, I would not recommend that - |
Beta Was this translation helpful? Give feedback.
Hey @GhostOrder28! I think we typically expect icons to be sized in units (i.e. a
number
)evergreen/index.d.ts
Lines 3183 to 3187 in 10e8e23
If you have a specific use-case for a percentage or string-based value (and it was working as you expected), it should still work by casting it:
<ArrowUpIcon size={('100%' as any) as number} />
As for setting the class names directly, I would not recommend that -
ui-box
andglamor
both manage helper class creation/application and aren't really meant t…