We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to use with formik but I'm keep getting "Value: [Function anonymous]"
const [open, setOpen] = useState(false); const [value, setValue] = useState(null); const [items, setItems] = useState([ { label: "Tier 1", value: "Tier 1" }, { label: "Tier 2", value: "Tier 2" }, ]); const onOpen = useCallback(() => { console.log("Open"); }); const initialValues = { buildingTo: selectedBuildingTo, tier: "", }; const handleFormSubmit = (values) => { console.log("values ", values); const allValues = { contract: selectedContract, building: selectedBuilding, buildingTo: selectedBuildingTo, tier: values.tier, }; console.log("All Form Values:", allValues); setIsLoading(true); // Show spinner }
<Formik initialValues={initialValues} validationSchema={validationSchema} onSubmit={handleFormSubmit} > {({ handleChange, handleBlur, handleSubmit, setFieldValue, values, errors, }) => { const onSubmit = () => { console.log("Submit button pressed. Form values:", values); handleFormSubmit(values); }; return ( <> <Modal transparent={true} animationType="slide" visible={isLoading} onRequestClose={() => {}} > <View style={styles.overlay}> <ActivityIndicator size="large" color="#4A7CFF" /> </View> </Modal> <View style={{ zIndex: 1, padding: 0 }}> <ContractBuildingSelector2 onContractSelect={setSelectedContract} onBuildingSelect={setSelectedBuilding} onBuildingSelectTo={setSelectedBuildingTo} /> </View> <DropDownPicker open={open} onOpen={onOpen} value={value} items={items} setOpen={setOpen} setValue={(value) => { setValue(value); console.log("Value:", value); setFieldValue("tier", value); }} setItems={setItems} /> <View style={styles.section}> <TouchableOpacity style={styles.button} onPress={onSubmit} disabled={isLoading} // Disable button while submitting > <Text style={styles.buttonText}>Submit</Text> </TouchableOpacity> </View> </> ); }} </Formik>
I tried lot of things, and the same setValue methode I use in a different form and there is working fine... Any ide what is the problem?
The text was updated successfully, but these errors were encountered:
const value = valueFunction() === your value. 🤷
const value = valueFunction()
Sorry, something went wrong.
Thank you! :) I'm new yet
No branches or pull requests
I'm trying to use with formik but I'm keep getting "Value: [Function anonymous]"
I tried lot of things, and the same setValue methode I use in a different form and there is working fine...
Any ide what is the problem?
The text was updated successfully, but these errors were encountered: