Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayField sortable={false} console warnings #3157

Closed
blamze opened this issue Apr 23, 2019 · 3 comments · Fixed by #3164
Closed

ArrayField sortable={false} console warnings #3157

blamze opened this issue Apr 23, 2019 · 3 comments · Fixed by #3164
Assignees
Labels

Comments

@blamze
Copy link

blamze commented Apr 23, 2019

Description:
Adding sortable={false} in ArrayField component prints react warrnings in console (but it disables sorting)

console error
Warning: Received false for a non-boolean attribute sortable.
If you want to write it to the DOM, pass a string instead: sortable="false" or sortable={value.toString()}.
If you used to conditionally omit it with sortable={condition && value}, pass sortable={condition ? value : undefined} instead.

Actually, in all cases if you put it like
<ArrayField source="categories" sortable}>
or
<ArrayField source="categories" sortable={true}>
it says it want non-boolean , but if you provide string - it says it wants boolean
(Warning: Failed prop type: Invalid prop sortable of type string supplied to EnhancedArrayField, expected boolean.)

What you were expecting:
Clean console

What happened instead:
http://prntscr.com/nfr89v

Steps to reproduce:

<ArrayField source="categories" sortable={false}>
  <SingleFieldList>
     <ChipField source="title" />
  </SingleFieldList>
</ArrayField>

Environment
"react": "16.8.6",
"react-admin": "2.8.6",

@blamze blamze changed the title ArrayField turn off sortable ArrayField sortable={false} console warnings Apr 23, 2019
@JasonasIgn
Copy link

Having this as well

@iamsimakov
Copy link

hey guys, I use ArrayField with Datagrid:

<ArrayField source="jobs">
  <Datagrid>
    <TextField source="status" />
    <TextField source="error" />
    <DateField source="updated_at" showTime />
  </Datagrid>
</ArrayField>

and now I see error on click column header:

Datagrid.js:162 Uncaught TypeError: _this.props.setSort is not a function
    at Datagrid._this.updateSort (Datagrid.js:162)

is this related with topic issue?

@fzaninotto fzaninotto added the bug label Apr 25, 2019
@fzaninotto
Copy link
Member

Reproduced and confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants