Skip to content

Show property from a complext object #625

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

Closed
diegooferreira opened this issue May 17, 2019 · 1 comment
Closed

Show property from a complext object #625

diegooferreira opened this issue May 17, 2019 · 1 comment

Comments

@diegooferreira
Copy link

Expected Behavior

I would like to display in the rows a property of a complex object. For example: object.name

Current Behavior

Error in console, white in full screen.
Console Error: Uncaught Invariant Violation: Objects are not valid as a React child (found: object with keys {codigo, descricao, resumo, valor}). If you meant to render a collection of children, use an array instead.

I would like to show just one of these properties.

I've tried:

const columnsDetail = 
[{
    name: "sabor",
    label: "Sabor"
},      
{
    name: "quantidade",
    label: "Qtde."
}]
const columnsDetail = 
[{
    name: "sabor.descricao",
    label: "Sabor"
},      
{
    name: "quantidade",
    label: "Qtde."
}]

I tried use customBodyRender too, but no success.

Sample of my data:

[
      {
        "pedido":0,
        "quantidade":3,
        "sabor":{ "codigo":0,"descricao":"NICE CAKE","resumo":null,"valor":6.0 }
      }
]

Is It possible to do That?

@gabrielliwerant
Copy link
Collaborator

This functionality should be available in 2.5.0 thanks to #619.

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

No branches or pull requests

2 participants