Skip to main content
Version: Current (v7.0.0-beta.3)

UseAltDateWidgetResult has a required buttonsDisabled

Detect​

  • In your TypeScript, an object typed UseAltDateWidgetResult built by hand, such as a mocked return of useAltDateWidgetProps().
  • 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: