Material-table: React does not recognize the `getFieldValue` prop on a DOM element

Created on 11 Jul 2019  ·  21Comments  ·  Source: mbrn/material-table

Describe the bug
The bug appears at the first click on the add button.
To Reproduce
Steps to reproduce the behavior:
1- Use material table editable options.
2- Add one columns with Add button
3- Error appears on console

Screenshots
Capture d’écran 2019-07-11 à 09 29 09

Code
<MaterialTable title="Experiences" icons={tableIcons} columns={this.state.columnsExperiences} data={this.state.products} options={{ search: false }} components={{ Toolbar : props => { return ( <Grid container direction="row" justify="space-between" alignItems="center" style={{padding: 10}}> <Grid item> {props.title} </Grid> <Grid item/> <Grid item> <ButtonCustom color="primary" ref={this.ref} onClick={(event) => props.actions[0].onClick(event, props.data)}> + </ButtonCustom> </Grid> </Grid> ) }, }} editable={{ onRowAdd: newData => new Promise(resolve => { resolve(); const products = [...this.state.products]; products.push(newData); this.setState({ ...this.state, products }); }), onRowUpdate: (newData, oldData) => new Promise(resolve => { resolve(); const products = [...this.state.products]; products[products.indexOf(oldData)] = newData; this.setState({ ...this.state, products }); }), onRowDelete: oldData => new Promise(resolve => { resolve(); const products = [...this.state.products]; products.splice(products.indexOf(oldData), 1); this.setState({ ...this.state, products }); }), }} />

Desktop (please complete the following information):

  • OS: MACOS
  • Browser : CHROME
bug

Most helpful comment

I recently encounter this warning: React does not recognize the errorState prop on a DOM element.

While in my own code I am not passing any error state, I don't know where it comes from.
image

All 21 comments

I am experiencing the same issue, as well as:

Warning: Unknown event handler property `onRowDataChange`. It will be ignored.
    in div (created by ForwardRef(FormControl))
    in ForwardRef(FormControl) (created by WithStyles(ForwardRef(FormControl)))
    in WithStyles(ForwardRef(FormControl)) (created by ForwardRef(TextField))
    in ForwardRef(TextField) (created by WithStyles(ForwardRef(TextField)))
    in WithStyles(ForwardRef(TextField)) (created by MTableEditField)
    in MTableEditField (created by MTableEditRow)
    in td (created by ForwardRef(TableCell))
    in ForwardRef(TableCell) (created by WithStyles(ForwardRef(TableCell)))
    in WithStyles(ForwardRef(TableCell)) (created by MTableEditRow)
    in tr (created by ForwardRef(TableRow))
    in ForwardRef(TableRow) (created by WithStyles(ForwardRef(TableRow)))
    in WithStyles(ForwardRef(TableRow)) (created by MTableEditRow)
    in MTableEditRow (created by MTableBody)
    in tbody (created by ForwardRef(TableBody))
    in ForwardRef(TableBody) (created by WithStyles(ForwardRef(TableBody)))
    in WithStyles(ForwardRef(TableBody)) (created by MTableBody)
    in MTableBody (created by Droppable)
    in table (created by ForwardRef(Table))
    in ForwardRef(Table) (created by WithStyles(ForwardRef(Table)))
    in WithStyles(ForwardRef(Table)) (created by Droppable)
    in div (created by Droppable)
    in div (created by Droppable)
    in Droppable (created by ConnectFunction)
    in ConnectFunction
    in ConnectFunction (created by MaterialTable)
    in div (created by ScrollBar)
    in ScrollBar (created by MaterialTable)
    in div (created by ForwardRef(Paper))
    in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper)))
    in WithStyles(ForwardRef(Paper)) (created by Container)
    in Container (created by MaterialTable)
    in Provider (created by App)
    in App (created by ErrorBoundary)
    in ErrorBoundary (created by DragDropContext)
    in DragDropContext (created by MaterialTable)
    in MaterialTable
    in Unknown (created by WithStyles(Component))
    in WithStyles(Component) (created by ReasonCodes)
    in ReasonCodes (created by Context.Consumer)
    in Route (created by RouteWithSubRoutes)
    in RouteWithSubRoutes (created by AppRoutes)
    in Router (created by HashRouter)
    in HashRouter (created by AppRoutes)
    in AppRoutes (created by App)
    in ThemeProvider (created by App)
    in App
    in StylesProvider
    in Provider

As a result I cannot add or edit anything in my table.

Any ideas?

Same issue

same issue, and and likely related to #822

same issue

same issue

same issue when running the example on my project

same for me. I'm using this in an electronjs app. I literally just took the example source code and ran it.

same form me

same issue

Same issue here. Thanks.

Hi
Which version of MT do you use?

I am using version 1.40.0.

same issue

this was fixed on version 1.41

@ErreMalote was it?

While I've encountered the similar error with editable functionality, and it definitely is lurking in there somewhere, I cannot repeat it in 1.50.0 with the sample code provided by @klein-h. I guess this one can be closed @mbrn

I just encountered this issue when trying to edit a child-value in a tree, at version 1.50.0.
The problem is the missing property getFieldValue in m-table-body-row.js:

return (
  <this.props.components.EditRow
    …
    getFieldValue={this.props.getFieldValue}

This is fixed in version 1.52.0

occurring again at "material-table": "^1.64.0"

I recently encounter this warning: React does not recognize the errorState prop on a DOM element.

While in my own code I am not passing any error state, I don't know where it comes from.
image

material-table v1.64.0

index.js:1 Warning: React does not recognize the `errorState` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `errorstate` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in td (created by ForwardRef(TableCell))
    in ForwardRef(TableCell) (created by WithStyles(ForwardRef(TableCell)))
    in WithStyles(ForwardRef(TableCell)) (created by MTableCell)
    in MTableCell (created by MTableBodyRow)
    in tr (created by ForwardRef(TableRow))
    in ForwardRef(TableRow) (created by WithStyles(ForwardRef(TableRow)))
    in WithStyles(ForwardRef(TableRow)) (created by MTableBodyRow)
    in MTableBodyRow (created by MTableGroupRow)
    in MTableGroupRow (created by MTableBody)

This is fixed with 1.65.0

Was this page helpful?
0 / 5 - 0 ratings