import React , { useEffect } from 'react' ; import ReactGridLayout , { WidthProvider } from 'react-grid-layout' ; import 'react-grid-layout/css/styles.css' ; const GridWithProvider = WidthProvider ( ReactGridLayout ) ; const useGridFix = ( ) => { useEffect ( ( ) => { setTimeout ( ( ) => window . dispatchEvent ( new Event ( 'resize' ) ) ) ; } , [ ] ) ; } ; const ReactGridLayoutFixed = ( props ) => { useGridFix ( ) ; return ( < div style = { { position : 'relative' } } > < GridWithProvider { ... props } / > < /div>); } ; export default ReactGridLayoutFixed ;