From b413193cb7d6673269ee335d6a419cc329eab462 Mon Sep 17 00:00:00 2001 From: Paoda Date: Fri, 8 Feb 2019 22:24:01 -0600 Subject: [PATCH] Formatting & identification of a table regeneration bug --- src/components/Body.js | 12 ++++++-- src/components/Body/Table.js | 39 ++++++++++++++++++++----- src/components/Modal/SettingsManager.js | 14 +++++---- 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/src/components/Body.js b/src/components/Body.js index f9a8923..e121844 100644 --- a/src/components/Body.js +++ b/src/components/Body.js @@ -16,18 +16,23 @@ export default class Body extends React.Component { /** @listens Table#newTable loads new Table*/ handleEvents() { + const self = this; Emitter.on("newTable", (obj, err) => { if (err) throw err; - this.setState({ table: obj }); + + console.log("newTable", obj); + debugger; + self.setState({ table: obj }); }); } componentWillMount() { this.initialize(); } - shouldComponentUpdate(nextProps, nextState) { - return this.state.table !== nextState.table; + shouldComponentUpdate(nextProps, state) { + return this.state.table.id !== state.table.id; } render() { + console.warn("Render:", this.state.table); return (