Skip to content

Commit f7fe773

Browse files
committed
Add forwardRef to CompanionWindow
1 parent 5daa657 commit f7fe773

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/components/CompanionWindow.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ const StyledCloseButton = styled(MiradorMenuButton, { name: 'CompanionWindow', s
2626
/**
2727
* CompanionWindow
2828
*/
29-
export function CompanionWindow(props) { // eslint-disable-line react/require-default-props
29+
export const CompanionWindow = forwardRef((props, innerRef) => { // eslint-disable-line react/require-default-props
3030
const {
3131
ariaLabel = undefined, classes = {}, direction, paperClassName = '', onCloseClick = () => {}, updateCompanionWindow = undefined, isDisplayed = false,
3232
position = null, title = null, children = undefined, titleControls = null,
33-
defaultSidebarPanelWidth = 235, defaultSidebarPanelHeight = 201, innerRef = undefined,
33+
defaultSidebarPanelWidth = 235, defaultSidebarPanelHeight = 201,
3434
} = props;
3535
const [sizeRef, size] = useElementSize();
3636
const { t } = useTranslation();
@@ -183,7 +183,7 @@ export function CompanionWindow(props) { // eslint-disable-line react/require-de
183183
</StyledRnd>
184184
</Root>
185185
);
186-
}
186+
});
187187

188188
CompanionWindow.propTypes = {
189189
ariaLabel: PropTypes.string,
@@ -192,10 +192,6 @@ CompanionWindow.propTypes = {
192192
defaultSidebarPanelHeight: PropTypes.number,
193193
defaultSidebarPanelWidth: PropTypes.number,
194194
direction: PropTypes.string.isRequired,
195-
innerRef: PropTypes.oneOfType([
196-
PropTypes.func,
197-
PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
198-
]),
199195
isDisplayed: PropTypes.bool,
200196
onCloseClick: PropTypes.func,
201197
paperClassName: PropTypes.string,

0 commit comments

Comments
 (0)