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
Throws: Cannot read property 'defaultPrevented' of undefined
I'm using Transition component with as={React.Fragment} to let classNames attached to it's child, but got an error when an event handler called with no arguments. I think not all event handlers needs arguments e.g. onMounted().
We are assuming that the first argument is an object:
Hey! Thank you for your suggestion!
Much appreciated! 🙏
This should be fixed by #1715, and will be available in the next release. I also marked you as a co-author because of your initial work here. I had to deal with the SyntethicEvents from React but that's been taken care of now. Thanks!
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
1.6.6
What browser are you using?
N/A
Reproduction URL
https://codesandbox.io/s/busy-heisenberg-50vxqe-50vxqe?file=/src/App.tsx
Describe your issue
I'm using
Transition
component withas={React.Fragment}
to let classNames attached to it's child, but got an error when an event handler called with no arguments. I think not all event handlers needs arguments e.g.onMounted()
.We are assuming that the first argument is an object:
headlessui/packages/@headlessui-react/src/utils/render.ts
Lines 235 to 240 in 5af3bd4
On the other hand, we applied optional chaining to @headlessui/vue at the same place, that works but does not matches its declaration:
headlessui/packages/@headlessui-vue/src/utils/render.ts
Lines 219 to 223 in 5af3bd4
And considering they may called with object literals like
onChange({ ...foo, defaultPrevented: 0 })
, here's my suggestion:The text was updated successfully, but these errors were encountered: