1- import { Children , cloneElement } from 'react' ;
1+ /* eslint-disable react/require-default-props */
2+ import { Children , cloneElement , forwardRef } from 'react' ;
23import PropTypes from 'prop-types' ;
34import { styled } from '@mui/material/styles' ;
45import CloseIcon from '@mui/icons-material/CloseSharp' ;
@@ -26,11 +27,11 @@ const StyledCloseButton = styled(MiradorMenuButton, { name: 'CompanionWindow', s
2627/**
2728 * CompanionWindow
2829 */
29- export function CompanionWindow ( props ) { // eslint-disable-line react/require-default-props
30+ export const CompanionWindow = forwardRef ( ( props , innerRef ) => {
3031 const {
3132 ariaLabel = undefined , classes = { } , direction, paperClassName = '' , onCloseClick = ( ) => { } , updateCompanionWindow = undefined , isDisplayed = false ,
3233 position = null , title = null , children = undefined , titleControls = null ,
33- defaultSidebarPanelWidth = 235 , defaultSidebarPanelHeight = 201 , innerRef = undefined ,
34+ defaultSidebarPanelWidth = 235 , defaultSidebarPanelHeight = 201 ,
3435 } = props ;
3536 const [ sizeRef , size ] = useElementSize ( ) ;
3637 const { t } = useTranslation ( ) ;
@@ -183,7 +184,7 @@ export function CompanionWindow(props) { // eslint-disable-line react/require-de
183184 </ StyledRnd >
184185 </ Root >
185186 ) ;
186- }
187+ } ) ;
187188
188189CompanionWindow . propTypes = {
189190 ariaLabel : PropTypes . string ,
@@ -192,10 +193,6 @@ CompanionWindow.propTypes = {
192193 defaultSidebarPanelHeight : PropTypes . number ,
193194 defaultSidebarPanelWidth : PropTypes . number ,
194195 direction : PropTypes . string . isRequired ,
195- innerRef : PropTypes . oneOfType ( [
196- PropTypes . func ,
197- PropTypes . shape ( { current : PropTypes . instanceOf ( Element ) } ) ,
198- ] ) ,
199196 isDisplayed : PropTypes . bool ,
200197 onCloseClick : PropTypes . func ,
201198 paperClassName : PropTypes . string ,
@@ -208,3 +205,5 @@ CompanionWindow.propTypes = {
208205 titleControls : PropTypes . node ,
209206 updateCompanionWindow : PropTypes . func ,
210207} ;
208+
209+ CompanionWindow . displayName = 'CompanionWindow' ;
0 commit comments