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
To use an icon property in React + TypeScript one has to do: React.icons = icons from exported icons object in an index.tsx file but it is not possible in TypeScript.
Then the only option that is left in CSidebarNavItem is to use a fontIcon prop instead of icon prop to generate an icon with a string (for example 'cil-memory'). After updating to 3.1.0 the <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" class="c-sidebar-nav-icon" role="img">undefined</svg> element is generated even if the icon prop is not specified. Setting icon to undefined or null does not fix this issue. This creates a problem with a display of sidebar items and it is pushing them to the right.
Doing import { cilQrCode } from '@coreui/icons' on top of a file and then passing icon={cilQrCode} does not work too.
In general I think you should adjust the setting of an icon in some easier manner while using React + TypeScript. Maybe exactly how fontIcon prop worked in previous versions or how icon is set in a CIcon component.
The text was updated successfully, but these errors were encountered:
To use an
icon
property in React + TypeScript one has to do:React.icons = icons
from exported icons object in anindex.tsx
file but it is not possible in TypeScript.Then the only option that is left in
CSidebarNavItem
is to use afontIcon
prop instead oficon
prop to generate an icon with a string (for example 'cil-memory'). After updating to 3.1.0 the<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" class="c-sidebar-nav-icon" role="img">undefined</svg>
element is generated even if theicon
prop is not specified. Settingicon
toundefined
ornull
does not fix this issue. This creates a problem with a display of sidebar items and it is pushing them to the right.Doing
import { cilQrCode } from '@coreui/icons'
on top of a file and then passingicon={cilQrCode}
does not work too.In general I think you should adjust the setting of an icon in some easier manner while using React + TypeScript. Maybe exactly how
fontIcon
prop worked in previous versions or how icon is set in aCIcon
component.The text was updated successfully, but these errors were encountered: