React components not updating at array state change when navigation.goBack() with data
up vote
0
down vote
favorite
This is my function which is change components in array.
First of all it works fine in live development mode so i built apk file with expo. After that i installed apk file on my phone but the function doest'n work. Is it bug or my mistake. How can i fix this error
onSelect = data =>
var tempSelectable=this.state.storeData;
if(data.category=='drink')
tempSelectable.splice(this.state.count,1,<ItemDetailCoreView key=data.itemKey/>);
else
tempSelectable.splice(data.itemKey,1,<ItemDetailCoreView key=data.itemKey/>);
this.setState(flexibleValue:tempSelectable);
This is my navigate line of code
this.props.navigation.navigate('Options',key:key,onSelect:this.onSelect )
In Options Screen if i choose any item i have to back previous screen with select item data
chosen(data)
const navigation = this.props;
navigation.goBack();
navigation.state.params.onSelect( chosen: data, category:this.state.category, itemKey:this.state.key);
react-native react-navigation
add a comment |
up vote
0
down vote
favorite
This is my function which is change components in array.
First of all it works fine in live development mode so i built apk file with expo. After that i installed apk file on my phone but the function doest'n work. Is it bug or my mistake. How can i fix this error
onSelect = data =>
var tempSelectable=this.state.storeData;
if(data.category=='drink')
tempSelectable.splice(this.state.count,1,<ItemDetailCoreView key=data.itemKey/>);
else
tempSelectable.splice(data.itemKey,1,<ItemDetailCoreView key=data.itemKey/>);
this.setState(flexibleValue:tempSelectable);
This is my navigate line of code
this.props.navigation.navigate('Options',key:key,onSelect:this.onSelect )
In Options Screen if i choose any item i have to back previous screen with select item data
chosen(data)
const navigation = this.props;
navigation.goBack();
navigation.state.params.onSelect( chosen: data, category:this.state.category, itemKey:this.state.key);
react-native react-navigation
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This is my function which is change components in array.
First of all it works fine in live development mode so i built apk file with expo. After that i installed apk file on my phone but the function doest'n work. Is it bug or my mistake. How can i fix this error
onSelect = data =>
var tempSelectable=this.state.storeData;
if(data.category=='drink')
tempSelectable.splice(this.state.count,1,<ItemDetailCoreView key=data.itemKey/>);
else
tempSelectable.splice(data.itemKey,1,<ItemDetailCoreView key=data.itemKey/>);
this.setState(flexibleValue:tempSelectable);
This is my navigate line of code
this.props.navigation.navigate('Options',key:key,onSelect:this.onSelect )
In Options Screen if i choose any item i have to back previous screen with select item data
chosen(data)
const navigation = this.props;
navigation.goBack();
navigation.state.params.onSelect( chosen: data, category:this.state.category, itemKey:this.state.key);
react-native react-navigation
This is my function which is change components in array.
First of all it works fine in live development mode so i built apk file with expo. After that i installed apk file on my phone but the function doest'n work. Is it bug or my mistake. How can i fix this error
onSelect = data =>
var tempSelectable=this.state.storeData;
if(data.category=='drink')
tempSelectable.splice(this.state.count,1,<ItemDetailCoreView key=data.itemKey/>);
else
tempSelectable.splice(data.itemKey,1,<ItemDetailCoreView key=data.itemKey/>);
this.setState(flexibleValue:tempSelectable);
This is my navigate line of code
this.props.navigation.navigate('Options',key:key,onSelect:this.onSelect )
In Options Screen if i choose any item i have to back previous screen with select item data
chosen(data)
const navigation = this.props;
navigation.goBack();
navigation.state.params.onSelect( chosen: data, category:this.state.category, itemKey:this.state.key);
react-native react-navigation
react-native react-navigation
asked Nov 11 at 6:35
VPrideV
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246428%2freact-components-not-updating-at-array-state-change-when-navigation-goback-wit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown