Getting type error on checkbox api.controlProps
on SVG element
#1393
Answered
by
segunadebayo
vincerubinetti
asked this question in
Q&A
-
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.
Answered by
segunadebayo
Apr 3, 2024
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.
2 replies
Answer selected by
segunadebayo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.