Skip to content

Instantly share code, notes, and snippets.

@adamkleingit
Created July 16, 2017 11:46
Show Gist options
  • Save adamkleingit/7ee7456c60290b24f40f25b91be73e90 to your computer and use it in GitHub Desktop.
Save adamkleingit/7ee7456c60290b24f40f25b91be73e90 to your computer and use it in GitHub Desktop.
const renderGridRowCell = (colConfig, row, index) => {
const CustomValue = colConfig.component;
const value = CustomValue ? <CustomValue data={ row }/> : row[colConfig.field];
return <td key={ index }>{ value }</td>;
};
const renderGridRowCell = ({ Component: component, field }, row, index) => (
<td key={ index }>
{
Component ? <Component data={ row }/> : row[field]
}
</td>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment