Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Shimmer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
type ViewStyle,
Dimensions,
type LayoutChangeEvent,
Platform,
} from 'react-native';
import Animated, {
Easing,
Expand Down Expand Up @@ -51,7 +52,11 @@
const measure = useCallback(
(event: LayoutChangeEvent) => {
if (componentWidth === 0) {
event.target.measureInWindow((x, _y, width) => {
const measureInWindowFn =
Platform.OS === 'web'
? event.nativeEvent.target.measureInWindow

Check failure on line 57 in src/Shimmer.tsx

View workflow job for this annotation

GitHub Actions / lint

Property 'target' does not exist on type '{ layout: LayoutRectangle; }'.
: event.target.measureInWindow;
measureInWindowFn((x, _y, width) => {

Check failure on line 59 in src/Shimmer.tsx

View workflow job for this annotation

GitHub Actions / lint

Parameter 'width' implicitly has an 'any' type.

Check failure on line 59 in src/Shimmer.tsx

View workflow job for this annotation

GitHub Actions / lint

Parameter '_y' implicitly has an 'any' type.

Check failure on line 59 in src/Shimmer.tsx

View workflow job for this annotation

GitHub Actions / lint

Parameter 'x' implicitly has an 'any' type.
setComponentWidth(width);
setOffset(x);
});
Expand Down
Loading