I should click two times before sending data with axios or send params in route in my expo --dev-client

const onAddNamePress = async (data: any) => {
navigation.navigate(‘AddGender’, { name: fullName })
Here I’m just sending params name to AddGender screen but when I clicked once, no params is sent and I must goback and click again for make it fine.

I should do the same process when I use axios to request Api.

Is it a bug or my code has problem ?

Hey @lordisasi, this doesn’t seem a Dev Client issue.

You’ll have to ensure that data.fullname is available before pressing the button and triggering onAddNamePress. When the value is available, the params will be available on the second screen.


Here is my login method and I still get the same error.

const login = async (email, password) => {
await axios.post(${BASE_URL}/users/login, {
headers: {
“Content-Type”: “application/json”,
Accept: ‘Application/json’,
.then(res => {
let userInfo = res.data;
AsyncStorage.setItem(‘userInfo’, JSON.stringify(userInfo));
ToastAndroid.showWithGravity(${email} s'est connecté avec succès , ToastAndroid.LONG, ToastAndroid.BOTTOM)
.catch(error => {
ToastAndroid.showWithGravity(${JSON.stringify(error.response.data.message) || "Une erreur s'est produite\nReéssayez"}, ToastAndroid.LONG, ToastAndroid.BOTTOM)
error.response.data ? console.log(Login Error ${JSON.stringify(error.response.data)}) : console.log(error);;

I still get the same problem

In the above code you shared, I don’t see any params passed through naivgation.navigate() method.

It’s kinda hard to see where the problem might be. I’d suggest you share a minimal reproducible example so that I can clone it and run it on my end.

Here I get the same problem using axios.post() … after that, I must click two time before sending data to API