From 2d936a2850c4b3064e9de1cb333f32de056938f8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 3 Aug 2016 18:23:38 +0100 Subject: [PATCH] Don't leave isRoomPublished as undefined As this causes react to consider the component uncontrolled and then warn when we change it to controlled --- src/components/views/rooms/RoomSettings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index b12c6e4aa2..8269c539f1 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -70,7 +70,9 @@ module.exports = React.createClass({ // is also called from the saving code so we must return the correct value here // if we have it (although this could race if the user saves before we load whether // the room is published or not). - isRoomPublished: this._originalIsRoomPublished, + // Default to false if it's undefined, otherwise react complains about changing + // components from uncontrolled to controlled + isRoomPublished: this._originalIsRoomPublished || false, }; },