I am working on app where I am using formik form, it working fine but I face one issue when I open camera and take a picture when get back the form filled lost . I want to keep all values persist if I open camera etc . I really tried hard but didn't find any solution . Could someone please help me how to resolve this issue.
Thanks
<Form
initialValues={{ username: "", email: '' }}
onSubmit={handleSubmit}
key={Math.random()}
>
<FormField
autoCapitalize="none"
autoCorrect={false}
icon="account"
keyboardType="email-address"
name="username"
placeholder="Username"
textContentType="emailAddress"
maxLength={20}
style={{ width: "100%" }}
/>
<ListItemSeparator />
<View style={{ marginVertical: 20 }}>
<>
<MaterialCommunityIcons name="camera" size={40} color="#666" onPress={() => cameraToggle(true)} />
<Image resizeMode="cover" source={{ uri: camerBinaryImage && camerBinaryImage.uri }} style={{ height: Object.keys(camerBinaryImage).length > 0 ? 300 : 0, width: Object.keys(camerBinaryImage).length > 0 ? 300 : 0 }} />
</>
</View>
<ListItemSeparator />
<AppText style={styles.slugTitle}>Email</AppText>
<ListItemSeparator />
<FormField
autoCapitalize="none"
autoCorrect={false}
keyboardType="email-address"
comment={true}
name="email"
placeholder="Email"
textContentType="emailAddress"
style={{ width: "100%" }}
/>
</Form>