🐛 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
panels input
- 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
🐛 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
panelsinputtsc -b[zag-js] missing required props: panels💻 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
zag/packages/frameworks/solid/src/machine.ts
Line 22 in 4899e1d
I'm not sure why that is, but maybe it's possible to remove that and do something else instead.
🌍 System information
📝 Additional information