Getting type error on checkbox api.controlProps
on SVG element
#1393
-
Thank you for the incredible library. It's been extremely flexible and robust in my usage of it so far. I have an SVG checkmark I'm using in a checkbox, like this: // react-icons svg
const Check = api.isChecked ? FaRegSquareCheck : FaRegSquare;
<Check {...api.controlProps} /> Typescript is complaining about the
It appears the type of Or maybe I'm using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @vincerubinetti, Control props should be spread into a div or span element. Then you can render the svg inside the control. If you really want to use the svg, I would recommend type casting. |
Beta Was this translation helpful? Give feedback.
Hi @vincerubinetti,
Control props should be spread into a div or span element. Then you can render the svg inside the control.
If you really want to use the svg, I would recommend type casting.