Skip to content

Commit

Permalink
fix: move @ts-expect-error to body to avoid issue in type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Oct 12, 2021
1 parent 0b40dd7 commit 0a08688
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ function BottomTabNavigator({
sceneContainerStyle,
...restWithDeprecated
}: Props) {
let {
const {
// @ts-expect-error: lazy is deprecated
lazy,
// @ts-expect-error: tabBarOptions is deprecated
tabBarOptions,
...rest
} = restWithDeprecated;

let defaultScreenOptions: BottomTabNavigationOptions = {};

if (tabBarOptions) {
Expand Down
18 changes: 11 additions & 7 deletions packages/drawer/src/navigators/createDrawerNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@ function DrawerNavigator({
children,
screenListeners,
screenOptions,
// @ts-expect-error: openByDefault is deprecated
openByDefault,
// @ts-expect-error: lazy is deprecated
lazy,
// @ts-expect-error: drawerContentOptions is deprecated
drawerContentOptions,
...rest
...restWithDeprecated
}: Props) {
const {
// @ts-expect-error: openByDefault is deprecated
openByDefault,
// @ts-expect-error: lazy is deprecated
lazy,
// @ts-expect-error: drawerContentOptions is deprecated
drawerContentOptions,
...rest
} = restWithDeprecated;

let defaultScreenOptions: DrawerNavigationOptions = {};

if (drawerContentOptions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,22 @@ function MaterialTopTabNavigator({
children,
screenListeners,
screenOptions,
// @ts-expect-error: swipeEnabled is deprecated
swipeEnabled,
// @ts-expect-error: lazy is deprecated
lazy,
// @ts-expect-error: lazyPlaceholder is deprecated
lazyPlaceholder,
// @ts-expect-error: lazyPreloadDistance is deprecated
lazyPreloadDistance,
// @ts-expect-error: tabBarOptions is deprecated
tabBarOptions,
...rest
...restWithDeprecated
}: Props) {
const {
// @ts-expect-error: swipeEnabled is deprecated
swipeEnabled,
// @ts-expect-error: lazy is deprecated
lazy,
// @ts-expect-error: lazyPlaceholder is deprecated
lazyPlaceholder,
// @ts-expect-error: lazyPreloadDistance is deprecated
lazyPreloadDistance,
// @ts-expect-error: tabBarOptions is deprecated
tabBarOptions,
...rest
} = restWithDeprecated;

let defaultScreenOptions: MaterialTopTabNavigationOptions = {};

if (tabBarOptions) {
Expand Down

0 comments on commit 0a08688

Please sign in to comment.