mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
Merge pull request #5159 from matrix-org/t3chguy/react-err
Fix react error about functional components can't take refs
This commit is contained in:
commit
a13cc0ce6a
1 changed files with 4 additions and 4 deletions
|
@ -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>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue