Here are two components centered with two different methods, one respects the scrollbar width, the other doesn't. Demo here: https://codepen.io/wgao19/pen/xxGJrNy
The two components are from two features maintained by different groups of people. So we should treat the two implementation details as black box.
BUTTTTTT, we need to make sure they align. So we need to offset one of them with scrollbar width.
Here are two components centered with two different methods, one respects the scrollbar width, the other doesn't. Demo here: https://codepen.io/wgao19/pen/xxGJrNy
The two components are from two features maintained by different groups of people. So we should treat the two implementation details as black box.
BUTTTTTT, we need to make sure they align. So we need to offset one of them with scrollbar width.
Then we found a geeky hack from Brian Vaugh's code: https://github.com/bvaughn/react-window/blob/master/src/domHelpers.js#L6