Typescript Accessibility #2436
Replies: 3 comments 2 replies
-
Having the same issue here as well. |
Beta Was this translation helpful? Give feedback.
-
Ask this question on typescript repo. It's not related to daisyUI. |
Beta Was this translation helpful? Give feedback.
-
Sorry to post in a closed thread. @Malewooo16 using your example, in Typescript just cast the element to HTMLDialogElement, like this:
That takes care of the errors for me. |
Beta Was this translation helpful? Give feedback.
-
It's really difficult to use components with functions such as modals with typescript, add types or documentations for typescript users.
<button className="btn" onClick={()=>document.getElementById('my_modal_2').showModal()}>open modal
()=>document.getElementById('my_modal_2: Object is possibly null
.showModal() Property 'showModal' does not exist on type 'HTMLElement'.
Beta Was this translation helpful? Give feedback.
All reactions