AutoSize component provide dimensions of container
yarn add react-autosize-container --save
import { AutoSize } from 'react-autosize-container'
export const TestExample = () => (
<AutoSize>
{({ width, height }) => (
<span>
My container is {width}px x {height}px
</span>
)}
</AutoSize>
)