push navigation not working with values
coming from Formik but works if I pass statically.
It's not working
const handleSubmit = (values) => {
SMSLogin({ variables: values }).then(({ data, errors }) => {
console.log(values.phone)
router.push({
pathname: "/sign-up-completion",
params: {
phone: values.phone,
},
});
});
};
but It's work
const handleSubmit = (values) => {
SMSLogin({ variables: values }).then(({ data, errors }) => {
console.log(values.phone)
router.push({
pathname: "/sign-up-completion",
params: {
phone: '+1 (920) 123-4567',
},
});
});
};
both console.log
s are showing correctly the phone
Why!? any idea?
- expo SDK 49
- expo-router 2.0.0
I'm not finding any standard solution yet. Finally, I decided to develop a patch to solve the problem temporarily:
Note:
useLocalSearchParams()
not worked with this patch. I'm using this code to access params in next screen: