componentDidMount() {
var value = AsyncStorage.getItem('name');
value.then((e)=>{
this.setState({
name: e.name
})
})
const namme = encodeURIComponent(this.state.name);
return fetch('http://www.example.com/user-list.php?name=${name}' , {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
I am still learning React Native and I was wondering if this is the correct way to pass parameters in the URL? I also heard about using Redux to help with this, but I don't know how to exactly implement that.