-
-
Notifications
You must be signed in to change notification settings - Fork 234
Closed
Description
🐛 Bug report
It seems that all properties in useMachine input are typed as optional, even if they are required in the documentation and in practice. This causes code that typechecks to fail in runtime.
💥 Steps to reproduce
- Create a splitter without a
panelsinput - see that it typechecks
tsc -b - see that the website doesn't load, and that the console log shows
[zag-js] missing required props: panels - add panels and see that it solves the issue.
💻 Link to reproduction
https://stackblitz.com/edit/sb1-3xdwzhmb?file=src%2FApp.tsx
🧐 Expected behavior
Since panels are a required property I would expect this to fail type checking.
🧭 Possible Solution
It seems that the input is partial'd on purpose, see
| userProps: Partial<T["props"]> | Accessor<Partial<T["props"]>> = {}, |
I'm not sure why that is, but maybe it's possible to remove that and do something else instead.
🌍 System information
| Software | Version(s) |
|---|---|
| Zag Version | 1.9.3 |
| Browser | Chrome 134.0.6998.166 |
| Operating System | MacOS 15.3.2 |
📝 Additional information
Metadata
Metadata
Assignees
Labels
No labels