diff --git a/src/ReorgTable.js b/src/ReorgTable.js index f87f691..9812190 100644 --- a/src/ReorgTable.js +++ b/src/ReorgTable.js @@ -1,55 +1,30 @@ import React, { useEffect, useState } from "react"; const ReorgTable = (props) => { - /* - * Generates the table based on the data passed into it. - */ - - const [jsx_data, changeData] = useState([]); - - useEffect(() => { - generate(); - }, []); - - - // useEffect( () => { - // generate(); - // }, ]); - - function generate(){ - /* - * Generates the JSX array. - */ - - console.log(props.data); - let table_array = [ - - Time - Name - Length of Reorg - - ]; - - for (let row = 0; row < props.data.length; row++){ - table_array.push( - - {props.data.timestamps[row]} - {props.data.names[row]} - {props.data.reorg_length[row]} - - ); - }; - - changeData(table_array); - }; - - // generate(); - return ( - - {jsx_data} -
+ console.log(props.data); + let table_array = [ + + Time + Name + Length of Reorg + + ]; + + for (let row = 0; row < props.data.length; row++){ + table_array.push( + + {props.data.timestamps[row]} + {props.data.names[row]} + {props.data.reorg_length[row]} + ); + }; + return ( + + {table_array} +
+ ); }; -export default ReorgTable; \ No newline at end of file +export default ReorgTable;