We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aebff14 commit a0a72f7Copy full SHA for a0a72f7
src/Shimmer.tsx
@@ -51,10 +51,9 @@ export const Shimmer = ({
51
const measure = useCallback(
52
(event: LayoutChangeEvent) => {
53
if (componentWidth === 0) {
54
- event.target.measureInWindow((x, _y, width) => {
55
- setComponentWidth(width);
56
- setOffset(x);
57
- });
+ const { width, x } = event.nativeEvent.layout;
+ setComponentWidth(width);
+ setOffset(x);
58
}
59
},
60
[componentWidth]
0 commit comments