Closed SymntxHomendra51 closed 1 year ago
Hi @SymntxHomendra51... I'm sorry but I'm not really able to follow the issue from the code. However, keep in mind calling showActionSheetWithOptions
is static and not bound to react state, so you probably just have an issue where the object receives the initial formikState
, and that's it. You would need to always pass in the new formik state to the method to get the current values.
Essentially, whenever formik rerenders it will create new instances of your setTemplate
function, however, the static action sheet method only got the first one. I would move your showTemplateList
to a useCallback
and pass in the formik values as an argument each time it's invoked.
In my case in android the callback is not refreshing after first call It was returning same values even after i call with state which is changed. Here formikValues is a state. It returns right object on first call but when i reselect after changing the formikvalues object it takes the get old formikvalues used in the first call.
I also tried calling this function outside of showactionSheetWithOptions it's working as expected.
Here is the code