Skip to content

Commit

Permalink
Add Upgrade guide
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Aug 28, 2019
1 parent f5e254c commit e670a45
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -799,3 +799,38 @@ const OrderEdit = (props) => (

Some components (such as `<SelectArrayInput />`) accepted the `helperText` in their `meta` prop. They now receive it directly in their props.
Besides, all components now display their error or their helperText, but not both at the same time.

## Form Inputs are now filled and dense by default

To better match the [Material Design](https://material.io/components/text-fields/) specification, react-admin defaults to the 'filled' variant for form inputs, and uses a *dense* margin to allow more compact forms. This will change the look and fill of existing forms built with `<SimpleForm>`, `<TabbedForm>`, and `<Filter>`. If you want your forms to look just like before, you need to set the `variant` and `margin` props as follows:

```diff
// for SimpleForm
const PostEdit = props =>
<Edit {...props}>
<SimpleForm
+ variant="standard"
+ margin="normal"
>
// ...
</SimpleForm>
</Edit>;
// for TabbedForm
const PostEdit = props =>
<Edit {...props}>
<TabbedForm
+ variant="standard"
+ margin="normal"
>
<FormTab label="Identity>
// ...
</FormTab>
</TabbedForm>
</Edit>;
// for Filter
const PostFilter = props =>
- <Filter>
+ <Filter variant="standard">
// ...
</Filter>;
```

0 comments on commit e670a45

Please sign in to comment.