Skip to content

Instantly share code, notes, and snippets.

@hai5nguy
Created November 22, 2016 15:41
Show Gist options
  • Save hai5nguy/2ef0f2222b7fac58cabc6a27344e491f to your computer and use it in GitHub Desktop.
Save hai5nguy/2ef0f2222b7fac58cabc6a27344e491f to your computer and use it in GitHub Desktop.
import React from 'react';
import { Component } from 'react';
import {connect} from 'react-redux';
import Table from './Table';
import TableColumns from './TableColumns';
import TableRows from './TableRows';
class TableContainer extends Component{
render(){
const {tableData} = this.props;
console.log("TABLE DATA: ", tableData); //TABLE DATA WILL SHOW HERE
if (tableData.lenght) {
var table = (
<Table>
<TableColumns data={tableData}/>
<TableRows data={tableData} />
</Table>
)
} else {
var table = undefined; //maybe null or '' here
}
return(
<div>
{table}
</div>
);
}
}
export default TableContainer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment