import * as React from 'react' import { Text, View } from 'react-native' import { navigationRef } from '../rootNavigation' import Loading from './Loading' export interface HeadTitleProps { label: string color: string headerProps?: any } export default class HeadTitle extends React.PureComponent { render () { // showLoading自定义的参数放在params中 const params: Record = navigationRef.current?.getCurrentRoute()?.params || {} const { showLoading = false } = params?.navigateConfig || {} const { label, color, headerProps } = this.props return {showLoading && } {headerProps?.children || label} } }