From 2a57cea5f76a2e5ed5af2dac7b6aed81550526b0 Mon Sep 17 00:00:00 2001 From: Nicholas Yang Date: Mon, 14 Oct 2019 19:46:06 -0400 Subject: [PATCH] Fixed name issue --- src/ReorgTable.js | 71 +++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 48 deletions(-) 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;