Sport
Sport

Reputation: 8945

React-navigation error when pushing new screen

ISSUE: issue is not coming in compile time , if its compile time then some thing wrong with syntax but its coming when I am pushing , and controls not reach to next screen means render and constructor .so issue at when I am pushing using navigation. some thing wrong to make push new screen but whats issue how to fix.

I am getting some error when trying to push new screen . same screen I am pushing from other screen its working fine , but I have added custom header in navigationOptions and setParams for custom action , all action working fine , now I am trying to go another screen from this screen getting issue not able to find what is issue ,

I am using "react-navigation": "1.0.0-beta.11",

code I used for header , and set action working fine

static navigationOptions = ({ navigation }) => ({
    title: '',
    headerTintColor: variables.white,
    headerStyle: { backgroundColor: variables.spoRed },
    gesturesEnabled: false,
    // custom header
    header: (
      <Header
        onChangeText={
          navigation.state.params && navigation.state.params.onChangeText
        }
        goBack={navigation.state.params && navigation.state.params.goBack}
        seachAction={
          navigation.state.params && navigation.state.params.seachAction
        }
      />
    ),
  });

here I setParams to fire action from header working fine

componentWillMount() {
        this.props.navigation.setParams({
          onChangeText: this.onChangeText,
          goBack: this.goBack,
          seachAction: this.seachAction,
        });

//here is my code to push new screen but getting error

this.props.navigation.navigate(
   'detail',
   {},
   NavigationActions.navigate({ routeName: 'DETAILSA' }),
 );

whats issue not able to find , what I am doing wrong here

enter image description here

Upvotes: 1

Views: 678

Answers (2)

vonovak
vonovak

Reputation: 1597

You're getting the error because the title is an empty string. Use title: ' ', or upgrade to latest version to solve the problem.

Upvotes: 1

pavloko
pavloko

Reputation: 990

I don't think the problem here is with react-navigation.

You're rendering a string somewhere that is not wrapped with Text. Maybe, check the render method of the component you use in detail route.

Upvotes: 0

Related Questions