R
R
Roman Rakzin2020-05-08 18:09:12
React Native
Roman Rakzin, 2020-05-08 18:09:12

Why is data not updating in React Native?

Why is the data not updated if I try to overwrite a variable? I run I_want_change_allPosts()

let allPosts=['blablabla'];
I_want_change_allPosts=()=>{
allPosts = null;
};

return (

onWillFocus={payload => ScreenUpdated(payload.action.routeName)}
/>



)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
khorark, 2020-05-14
@khorark

Please provide the entire component code, not just a few lines.
But if we are talking about React, then all data changes inside the component that the View should respond to are carried out through the this.setState method or the useState hook .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question