From d9a2516b37a1ee3dcda21c8a3446aa52fbd91a87 Mon Sep 17 00:00:00 2001 From: manubo Date: Mon, 30 Sep 2019 17:14:20 +0200 Subject: [PATCH] Forward ref in Popup component --- src/js/components/Popup.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/components/Popup.js b/src/js/components/Popup.js index 870f562..8d37ffd 100644 --- a/src/js/components/Popup.js +++ b/src/js/components/Popup.js @@ -1,9 +1,9 @@ -import React, { useEffect, useRef } from "react" +import React, { useEffect, useRef, forwardRef } from "react" import PropTypes from "prop-types" import queryString from "query-string" import { serializeProps } from "utils" -function Popup(props) { +const Popup = forwardRef((props, ref) => { const iFrameRef = useRef() const handleRequestClose = event => { @@ -49,7 +49,7 @@ function Popup(props) { ])(props) return ( -
+