UseAltDateWidgetResult has a required buttonsDisabled
Detect
- In your TypeScript, an object typed
UseAltDateWidgetResultbuilt by hand, such as a mocked return ofuseAltDateWidgetProps(). - The type checker reports
Property 'buttonsDisabled' is missing in type '{ … }' but required in type 'UseAltDateWidgetResult'.(TS2741) on it.
Change
useAltDateWidgetProps() returns buttonsDisabled, true when the widget is disabled or read-only, for its clear and now buttons (#5378). Add it to hand-built results:
const result: UseAltDateWidgetResult = {
elements,
handleChange,
handleClear,
handleSetNow,
+ buttonsDisabled: false,
};
Verify
The type checker accepts every UseAltDateWidgetResult you build.
Also read: