'How to set Formik InitialValues if field name is coming in props?

I have to set Formik to something like

initialValues={{ location: initialValue }}>

The name of the field is 'key.location' passed down to as props 'location'. How to set field name as 'key.location' instead of 'location' ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source