In the file AppbarExample.js, I declared state:

How to transfer this state to the header instead of subtitle?

Here's the code
/* @flow * /

import * as React from'react';
import {View, Platform, StyleSheet} from'react-native';
import {
} from'react-native-paper';
import type {Theme} from'react-native-paper/types';

type Props={
  navigation: any,
  theme: Theme,

const initialParams={
  showLeftIcon: true
  showSubtitle: true
  showSearchIcon: true
  showMoreIcon: true

const MORE_ICON=Platform.OS ==='ios'?'more-horiz':'more-vert';

class AppbarExample extends React.Component<Props>{

  static navigationOptions=({navigation})=>{
    const params={...initialParams,...navigation.state.params};

    return {
      header :(
          <Appbar.BackAction onPress={()=>navigation.goBack()}/>
            subtitle={params.showSubtitle?'subtitle': null}
          <Appbar.Action icon="search" onPress={()=>{}}/>
          <Appbar.Action icon={MORE_ICON} onPress={()=>{}}/>


  render() {
    const {
      theme: {
        colors: {background},
    const params={...initialParams,...navigation.state.params};

            backgroundColor: background,

const styles=StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: Colors.white,
    paddingVertical: 8,

export default withTheme(AppbarExample);

1 Answers 1

In the constructor, you can apply something like this
     makeSaveRequestCallback: this.makeSaveRequest.bind(this)

And in the static method, this pass can be accessed as navigation.state.makeSaveRequestCallback();

It also works with the usual parameters.