Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5159 from matrix-org/t3chguy/react-err
Browse files Browse the repository at this point in the history
Fix react error about functional components can't take refs
  • Loading branch information
t3chguy authored Sep 1, 2020
2 parents 3b68da5 + da97d88 commit a13cc0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/views/messages/UnknownBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import React from "react";
import React, {forwardRef} from "react";

export default ({mxEvent}) => {
export default forwardRef(({mxEvent}, ref) => {
const text = mxEvent.getContent().body;
return (
<span className="mx_UnknownBody">
<span className="mx_UnknownBody" ref={ref}>
{ text }
</span>
);
};
});

0 comments on commit a13cc0c

Please sign in to comment.