mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-28 20:35:19 +08:00
Fix formatting and flow errors
This commit is contained in:
committed by
satyajit.happy
parent
18fa1315cf
commit
6d7240f815
@@ -29,7 +29,7 @@ type State = {
|
||||
transitioningFromIndex: ?number,
|
||||
};
|
||||
|
||||
class MaterialTabView extends React.PureComponent<Props> {
|
||||
class MaterialTabView extends React.PureComponent<Props, State> {
|
||||
static defaultProps = {
|
||||
// fix for https://github.com/react-native-community/react-native-tab-view/issues/312
|
||||
initialLayout: Platform.select({
|
||||
@@ -116,7 +116,7 @@ class MaterialTabView extends React.PureComponent<Props> {
|
||||
_renderPanPager = props => <PagerPan {...props} />;
|
||||
|
||||
_handleAnimationEnd = () => {
|
||||
const { lazy } = this.props;
|
||||
const { lazy } = this.props;
|
||||
|
||||
if (lazy) {
|
||||
this.setState({
|
||||
@@ -181,12 +181,7 @@ class MaterialTabView extends React.PureComponent<Props> {
|
||||
};
|
||||
|
||||
_renderScene = ({ route }) => {
|
||||
const {
|
||||
renderScene,
|
||||
descriptors,
|
||||
lazy,
|
||||
optimizationsEnabled,
|
||||
} = this.props;
|
||||
const { renderScene, descriptors, lazy, optimizationsEnabled } = this.props;
|
||||
|
||||
if (lazy) {
|
||||
const { loaded } = this.state;
|
||||
@@ -194,7 +189,10 @@ class MaterialTabView extends React.PureComponent<Props> {
|
||||
const index = routes.findIndex(({ key }) => key === route.key);
|
||||
const { navigation } = descriptors[route.key];
|
||||
|
||||
const mustBeVisible = this._mustBeVisible({ index, focused: navigation.isFocused()});
|
||||
const mustBeVisible = this._mustBeVisible({
|
||||
index,
|
||||
focused: navigation.isFocused(),
|
||||
});
|
||||
|
||||
if (!loaded.includes(index) && !mustBeVisible) {
|
||||
return <View />;
|
||||
|
||||
@@ -29,7 +29,7 @@ export type InjectedProps = {
|
||||
};
|
||||
|
||||
export default function createTabNavigator(TabView: React.ComponentType<*>) {
|
||||
class NavigationView extends React.Component<*, State> {
|
||||
class NavigationView extends React.Component<*, *> {
|
||||
_renderScene = ({ route }) => {
|
||||
const { screenProps, descriptors } = this.props;
|
||||
const descriptor = descriptors[route.key];
|
||||
|
||||
@@ -206,10 +206,7 @@ class TabBarBottom extends React.Component<Props> {
|
||||
];
|
||||
|
||||
return (
|
||||
<SafeAreaView
|
||||
style={tabBarStyle}
|
||||
forceInset={safeAreaInset}
|
||||
>
|
||||
<SafeAreaView style={tabBarStyle} forceInset={safeAreaInset}>
|
||||
{routes.map((route, index) => {
|
||||
const focused = index === navigation.state.index;
|
||||
const scene = { route, focused };
|
||||
|
||||
Reference in New Issue
Block a user