Material-ui-pickers: Breaking changes from 3.2.2 to 3.2.3

Created on 21 Aug 2019  路  5Comments  路  Source: mui-org/material-ui-pickers

Breaking change

Environment

| Tech | Version |
| -------------------- | ------- |
| @material-ui/pickers | 3.2.3 |
| material-ui | ^4.3.2 |
| React | ^16.8.6 |
| Browser | Chrome |
| Peer library | "@date-io/date-fns": "^1.3.9", "date-fns": "^2.0.0-beta.5", |

Steps to reproduce

  1. This is not an obvious one - when a name of a third party component changes that causes our tests to break because testcafe needs string for their react selector. On a similar note I have seen failing tests when people are using snapshots for their jest tests -> these will also fail whenever the name change. i.e. the name changed from WrappedPurePicker to PickerWithState

  2. I am using React + Typescript and when I updated from 3.2.2 to 3.2.3 my typescript compiler started complaining that label is not defined and started kicking about name when I deleted label etc.

Expected behavior

  • When I downgrade to 3.2.2 everything works as expected and I dont need to change the props I am passing to the DatePicker component

Actual behavior

Typescript error

Live example

Code: We are using Formik for the forms so our component looks like this:

              <DateTimePicker
                data-tc="hello"
                key="hello"
                label="Hello"
                name="hello"
                showTodayButton
                allowKeyboardControl
                disablePast
                ampm={false}
                format="dd/MM/yyyy HH:mm"
                value={values.hello}
                onChange={value => setFieldValue('hello', value)}
                onClose={() => setFieldTouched('hello', true)}
              />

And when I have updated to version 3.2.3 it started throwing typescript errors:

  Property 'label' does not exist on type 'IntrinsicAttributes & DateValidationProps & BasePickerProps & { variant?: "inline" | "static" | "dialog" | undefined; } & Pick<ModalWrapperProps<{}>, "okLabel" | "cancelLabel" | ... 4 more ... | "DialogProps"> & Pick<...> & Pick<...> & DateTimePickerViewsProps & { ...; }'

Most helpful comment

See this codesandbox to reproduce the issue. Note that it takes some time in codesandbox for the error to show up. label is correctly applied to the text input, however it is not accepted by the typings.

All 5 comments

I'm experiencing the same thing with the autoOk and label properties on the KeyboardDatePicker component. It works fine in 3.2.2 but throws type error with the upgrade to 3.2.3

Please provide a way to reproduce it. Everything works fine for me with latest mateiral-ui and material-ui-pickers

See this codesandbox to reproduce the issue. Note that it takes some time in codesandbox for the error to show up. label is correctly applied to the text input, however it is not accepted by the typings.

I'm experiencing the same issue on 3.2.4. Dropping back to 3.2.2 fixed it.

I'm experimenting the same issue in 3.2.5. This issue should be reopened

Was this page helpful?
0 / 5 - 0 ratings

Related issues

killjoy2013 picture killjoy2013  路  3Comments

brett-patterson picture brett-patterson  路  3Comments

nicky-dev picture nicky-dev  路  3Comments

katy6514 picture katy6514  路  3Comments

callmeberzerker picture callmeberzerker  路  3Comments