NullPointer
NullPointer

Reputation: 1329

Change props of parent view in react native

I am using react native and for routing I use react-native-router-flux. My issue is that I want to change the props of a parent view by clicking on a button on my child view.

Route.js:

...
<Scene key="test" type="replace">
  <Scene key="home" component={Home} title="Home"/>
  <Scene key="home2" component={HomeTwo} />
</Scene>

Home.js:

...
constructor(){
super();
this.state = {
    loading: this.loading
};
...

_goToNextScene(){
    Actions.home2();
}

HomeTwo.js:

_changeProps() {
//here I want to change state loading of parentview Home
}

Is this even possible?

Kind regards

Upvotes: 0

Views: 654

Answers (1)

aksonov
aksonov

Reputation: 853

Have you tried Actions.home2({loading:this.state.loading} ) ?

Upvotes: 1

Related Questions