Skip to content
Merged
Changes from all commits
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
12 changes: 12 additions & 0 deletions src/components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
};
};
};
__viewConfig: {
validAttributes: {
style: {
display: boolean | null;
};
};
};
}

export const InnerScreen = React.forwardRef<View, ScreenProps>(
Expand All @@ -63,7 +70,7 @@
React.useImperativeHandle(ref, () => innerRef.current!, []);
const prevActivityState = usePrevious(props.activityState);

const setRef = (ref: ViewConfig) => {

Check warning on line 73 in src/components/Screen.tsx

View workflow job for this annotation

GitHub Actions / lint-js

'ref' is already declared in the upper scope on line 68 column 31
innerRef.current = ref;
props.onComponentRef?.(ref);
};
Expand Down Expand Up @@ -143,7 +150,7 @@
scrollEdgeEffects,
onGestureCancel,
style,
...props

Check warning on line 153 in src/components/Screen.tsx

View workflow job for this annotation

GitHub Actions / lint-js

'props' is already declared in the upper scope on line 68 column 24
} = rest;

if (active !== undefined && activityState === undefined) {
Expand All @@ -165,7 +172,7 @@
}
}

const handleRef = (ref: ViewConfig) => {

Check warning on line 175 in src/components/Screen.tsx

View workflow job for this annotation

GitHub Actions / lint-js

'ref' is already declared in the upper scope on line 68 column 31
// Workaround is necessary to prevent React Native from hiding frozen screens.
// See this PR: https://github.com/grahammendick/navigation/pull/860
if (ref?.viewConfig?.validAttributes?.style) {
Expand All @@ -178,6 +185,11 @@
...ref._viewConfig.validAttributes.style,
display: null,
};
} else if (ref?.__viewConfig?.validAttributes?.style) {
ref.__viewConfig.validAttributes.style = {
...ref.__viewConfig.validAttributes.style,
display: null,
};
}
setRef(ref);
};
Expand Down Expand Up @@ -275,7 +287,7 @@
style,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
onComponentRef,
...props

Check warning on line 290 in src/components/Screen.tsx

View workflow job for this annotation

GitHub Actions / lint-js

'props' is already declared in the upper scope on line 68 column 24
} = rest;

if (active !== undefined && activityState === undefined) {
Expand All @@ -283,7 +295,7 @@
}
return (
<Animated.View
style={[style, { display: activityState !== 0 ? 'flex' : 'none' }]}

Check warning on line 298 in src/components/Screen.tsx

View workflow job for this annotation

GitHub Actions / lint-js

Inline style: { display: "activityState !== 0 ? 'flex' : 'none'" }
ref={setRef}
{...props}
/>
Expand Down
Loading