import * as React from 'react'; import { Observer } from 'mobx-react'; interface ScrollWrapperProps { children: React.ReactNode; plotElementWidth: number; assignDummyScrollPaneRef: (el: HTMLDivElement) => void; scrollPane: HTMLDivElement; } function ScrollWrapper(props: ScrollWrapperProps) { const isPlotWideEnoughToScroll = props.scrollPane && props.scrollPane.clientWidth < props.plotElementWidth; return ( <> {isPlotWideEnoughToScroll && ( {() => (
)} )} {props.children} ); } export default ScrollWrapper;