javascript - How should I pass my prop to get a valid Array[Object] -


i'm trying use react-json-table build simple data table in react/redux project. when i'm passing data directly inside component, working fine. when i'm using props table doesn't show up.

so here code when i'm hard coding data :

var data = [{'alpha': 82, 'bravo': 20, 'charlie': 68}]; <jsontable rows={ data } /> 

it's working fine.

but when i'm passing exact same data through prop directly <jsontable rows={ props } /> doesn't work. i've check props console.log({props}), it's working fine.

any idea ? need format prop in specific way before using ?

thanks.

be sure passing data array in props component:

<jsontable rows={[props]}/> 

Comments