How to use a Typeahead to add object a array of variables to formik values either in one value or .. #3524
Replies: 2 comments
-
You need create a useEffect of selected obj and on this obj, you will set the values try this. const { values, setValues } = formik; ` const fName= selected[0]?.firstName; const lName= selected[0]?.firstName;
}, [selected]); ` So, you will be a update of the values using setValues from Formik |
Beta Was this translation helpful? Give feedback.
-
Poocoin is a powerful tool for cryptocurrency investors and traders who are looking for detailed insights and analysis on a wide range of cryptocurrencies. Its user-friendly interface, real-time price tracking, and community-driven approach make it a popular choice among both new and experienced investors. While its focus on meme coins may not be for everyone, it provides a unique perspective on the cryptocurrency market that can be helpful for investors who are interested in these types of projects. |
Beta Was this translation helpful? Give feedback.
-
I have a array that I am using for a search option for customer to search entire array to find item. When selected how do I add the selection to the formik value or be able to split the array in different formik value fields. For instance array: [id, firstName, lastName, phoneNumber, email]. The Typeahead will allow end user to search for any value. Then place the whole object array in one formik value or split the object array into separate formik values.
Beta Was this translation helpful? Give feedback.
All reactions