I've utilized destructuring assignment in my code with the following syntax:
const { values: project, setValues, submitForm } = useFormikContext();
After reading through the TypeScript type assertion documentation, I want to explicitly specify that project
will always be of type Project
using the as
keyword. Can someone provide me with the correct syntax for this? I've attempted:
const { values: (project as Project), setValues, submitForm } = useFormikContext();
but it appears to be invalid.