Hello, this is my code to create a dynamic table in react js, and this is working fine, but this component is data-dependent, here I am using field name with an object (obj.brand), I want to make it data-independent, how I should bind data for that, please help.
render() {
var header = Object.keys(this.state.data[0]);
const tableHeader = header && header.map(val=>
{
return (
});
const tableData = this.state.data && this.state.data.map(obj=>
{
return (
});
return (
}
Top comments (0)