+
{ room.topic }
{ getDisplayAliasForRoom(room) }
diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js
index 5b6c0f6d2d..275ec3fafa 100644
--- a/src/components/views/rooms/RoomHeader.js
+++ b/src/components/views/rooms/RoomHeader.js
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-import React from 'react';
+import React, {createRef} from 'react';
import PropTypes from 'prop-types';
import createReactClass from 'create-react-class';
import classNames from 'classnames';
@@ -56,6 +56,10 @@ module.exports = createReactClass({
};
},
+ UNSAFE_componentWillMount: function() {
+ this._topic = createRef();
+ },
+
componentDidMount: function() {
const cli = MatrixClientPeg.get();
cli.on("RoomState.events", this._onRoomStateEvents);
@@ -70,8 +74,8 @@ module.exports = createReactClass({
},
componentDidUpdate: function() {
- if (this.refs.topic) {
- linkifyElement(this.refs.topic);
+ if (this._topic.current) {
+ linkifyElement(this._topic.current);
}
},
@@ -204,7 +208,7 @@ module.exports = createReactClass({
}
}
const topicElement =
-
{ topic }
;
+
{ topic }
;
const avatarSize = 28;
let roomAvatar;
if (this.props.room) {
diff --git a/src/components/views/rooms/SearchBar.js b/src/components/views/rooms/SearchBar.js
index 5e0ac9a953..a53352ba1c 100644
--- a/src/components/views/rooms/SearchBar.js
+++ b/src/components/views/rooms/SearchBar.js
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-import React from 'react';
+import React, {createRef} from 'react';
import createReactClass from 'create-react-class';
const classNames = require('classnames');
const AccessibleButton = require('../../../components/views/elements/AccessibleButton');
@@ -29,6 +29,10 @@ module.exports = createReactClass({
});
},
+ UNSAFE_componentWillMount: function() {
+ this._search_term = createRef();
+ },
+
onThisRoomClick: function() {
this.setState({ scope: 'Room' }, () => this._searchIfQuery());
},
@@ -47,13 +51,13 @@ module.exports = createReactClass({
},
_searchIfQuery: function() {
- if (this.refs.search_term.value) {
+ if (this._search_term.current.value) {
this.onSearch();
}
},
onSearch: function() {
- this.props.onSearch(this.refs.search_term.value, this.state.scope);
+ this.props.onSearch(this._search_term.current.value, this.state.scope);
},
render: function() {
@@ -66,10 +70,10 @@ module.exports = createReactClass({
{_t("This Room")}
{_t("All Rooms")}
-
+
);
},
diff --git a/src/components/views/rooms/SlateMessageComposer.js b/src/components/views/rooms/SlateMessageComposer.js
index eb41f6729b..ebd9017d73 100644
--- a/src/components/views/rooms/SlateMessageComposer.js
+++ b/src/components/views/rooms/SlateMessageComposer.js
@@ -14,12 +14,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
-import React from 'react';
+import React, {createRef} from 'react';
import PropTypes from 'prop-types';
import { _t, _td } from '../../../languageHandler';
import CallHandler from '../../../CallHandler';
import MatrixClientPeg from '../../../MatrixClientPeg';
-import Modal from '../../../Modal';
import sdk from '../../../index';
import dis from '../../../dispatcher';
import RoomViewStore from '../../../stores/RoomViewStore';
@@ -27,7 +26,6 @@ import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore";
import Stickerpicker from './Stickerpicker';
import { makeRoomPermalink } from '../../../utils/permalinks/Permalinks';
import ContentMessages from '../../../ContentMessages';
-import classNames from 'classnames';
import E2EIcon from './E2EIcon';
@@ -143,6 +141,8 @@ class UploadButton extends React.Component {
super(props, context);
this.onUploadClick = this.onUploadClick.bind(this);
this.onUploadFileInputChange = this.onUploadFileInputChange.bind(this);
+
+ this._uploadInput = createRef();
}
onUploadClick(ev) {
@@ -150,7 +150,7 @@ class UploadButton extends React.Component {
dis.dispatch({action: 'require_registration'});
return;
}
- this.refs.uploadInput.click();
+ this._uploadInput.current.click();
}
onUploadFileInputChange(ev) {
@@ -182,7 +182,7 @@ class UploadButton extends React.Component {
onClick={this.onUploadClick}
title={_t('Upload file')}
>
-