Skip to content

Commit

Permalink
Replacement of react-select with @material-ui/lab/Autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
gerhat committed Mar 8, 2020
1 parent 395ee55 commit dfdcf4a
Show file tree
Hide file tree
Showing 6 changed files with 2,643 additions and 2,871 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
### [Versions](https://github.com/gerhat/material-ui-formik-components/releases)

## 0.6.0
###### _Mar 8, 2020_
### General
- Updated library and example packages to the latest versions
- Refactored Formik code in `example/src/SimpleFormExample.jsx` to not use the `render` prop

### Autocomplete
- Replaced `react-select` with `@material-ui/lab/Autocomplete` for improved compatibility

**Breaking changes**
- Prop `isMultiple` has been changed to `multiple`
- Props `label` and `required` must be provided as items in `textFieldProps` props e.g.
```javascript
textFieldProps={{
label: 'Country',
required: true,
variant: 'outlined',
}}
```
### Select
- Simplified select component by replacing `@material-ui/core/Select` with `@material-ui/core/TextField` + `select` prop _(see: https://material-ui.com/components/text-fields/#select)_


## 0.5.2
###### _Nov 24, 2019_
- Added missing ts export for `<DatePicker/>` - thanks [@cargallo](https://github.com/cargallo)
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The extension depends on the following packages:
- [Formik](https://jaredpalmer.com/formik) >= 2.0

**Optional**
- [React Select](https://react-select.com) >= 3.0 - used by `Autocomplete` and `Select`
- [Material-UI Lab](https://material-ui.com/components/about-the-lab/) >4.0 - used by `Autocomplete`
- [Material-UI Pickers](https://material-ui-pickers.dev/) >= 3.0 - used by `DatePicker` and `DateTimePicker`
- [material-ui-chip-input](https://github.com/TeamWertarbyte/material-ui-chip-input) >= 1.0 - used by `ChipInput`

Expand Down Expand Up @@ -54,7 +54,8 @@ class RegistrationForm extends React.PureComponent {
onSubmit={values => {
alert(`Username: ${values.username}\nGender: ${values.gender}`)
}}
render={props => (
>
{formik => (
<Form>
<Field name="username" label="Username" component={TextField} />
<Field
Expand All @@ -68,12 +69,12 @@ class RegistrationForm extends React.PureComponent {
]}
component={Select}
/>
<button type="submit" disabled={!props.dirty}>
<button type="submit" disabled={!formik.dirty}>
Submit
</button>
</Form>
)}
/>
</Formik>
</div>
)
}
Expand Down
Loading

0 comments on commit dfdcf4a

Please sign in to comment.