From 3cf9f5248bc2c82724c4deef2b1d226f0413bff3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 20 Nov 2015 18:21:00 +0000 Subject: [PATCH] Fix the ref we keep to be the react element and make velociraptor correctly track what nodes it had at the start (c.key not c.props.key) --- src/Velociraptor.js | 2 +- src/skins/vector/views/molecules/EventTile.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Velociraptor.js b/src/Velociraptor.js index df6b3c95..d973a17f 100644 --- a/src/Velociraptor.js +++ b/src/Velociraptor.js @@ -23,7 +23,7 @@ module.exports = React.createClass({ this.nodes = {}; var self = this; React.Children.map(this.props.children, function(c) { - self.children[c.props.key] = c; + self.children[c.key] = c; }); }, diff --git a/src/skins/vector/views/molecules/EventTile.js b/src/skins/vector/views/molecules/EventTile.js index 20d7f1ec..236e7b1f 100644 --- a/src/skins/vector/views/molecules/EventTile.js +++ b/src/skins/vector/views/molecules/EventTile.js @@ -70,10 +70,6 @@ module.exports = React.createClass({ return {menu: false, allReadAvatars: false}; }, - componentDidUpdate: function() { - this.readAvatarNode = ReactDom.findDOMNode(this.readAvatarNode); - }, - onEditClicked: function(e) { var MessageContextMenu = sdk.getComponent('molecules.MessageContextMenu'); var buttonRect = e.target.getBoundingClientRect() @@ -209,7 +205,7 @@ module.exports = React.createClass({ }, collectReadAvatarNode: function(node) { - this.readAvatarNode = node; + this.readAvatarNode = ReactDom.findDOMNode(node); }, render: function() {