-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show deprecation warning while toggling bottomTabs visibility on iOS (#…
…6409) On iOS the system doesn't support dynamically toggling bottomTabs at all so we had to hack through it which resulted in many issues with this feature. We plan on entirely removing it and stick to the framework's guidelines which means that toggling the bottomTabs will not be possible at all and controlling it with static options will be the only option.
- Loading branch information
Showing
3 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
import once from 'lodash/once'; | ||
import { Platform } from 'react-native'; | ||
|
||
export class Deprecations { | ||
public onProcessOptions(_key: string, _parentOptions: Record<string, any>) { | ||
|
||
public onProcessOptions(key: string, parentOptions: Record<string, any>, commandName: string) { | ||
if ( | ||
key === 'bottomTabs' && | ||
parentOptions[key].visible !== undefined && | ||
Platform.OS === 'ios' && | ||
commandName === 'mergeOptions' | ||
) { | ||
this.deprecateBottomTabsVisibility(parentOptions); | ||
} | ||
} | ||
|
||
public onProcessDefaultOptions(_key: string, _parentOptions: Record<string, any>) { | ||
public onProcessDefaultOptions(_key: string, _parentOptions: Record<string, any>) {} | ||
|
||
} | ||
private deprecateBottomTabsVisibility = once((parentOptions: object) => { | ||
console.warn( | ||
`toggling bottomTabs visibility is deprecated on iOS. For more information see https://github.com/wix/react-native-navigation/issues/6416`, | ||
parentOptions | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters