gregnb / gregnb/mui-datatables

Info Request: What does updateValue actually do?

Open
#545 3 comments 2 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

I'm using customBodyRender
```customBodyRender?: (value: any, tableMeta: MUIDataTableMeta, updateValue: (s: any, c: any, p: any) => any) => string | React.ReactNode;```

I am super curious on what exactly updateValue does and what the parameters are and how they function.

For some context, I am unable to pass lambdas into component attributes. So i have to create a function to have the code get called like so:
```
private handleOnChange = (tableMetaData: any, updateValue: any) => (e: React.ChangeEvent) => {
updateValue(e.currentTarget.value, tableMetaData.columnIndex)
}
```

but the update value gets called before the tableMetaData changes so my tableMetaData is always 1 "change" behind.

| Tech | Version |
|--------------|---------|
| Material-UI | 3.9.3 |
| MUI-datatables | 2.0.0-beta.59 |
| React | 16.8.6 |
| browser | Chrome Version 73.0.3683.86 |
| etc | Typescript 3.4.1 |

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.