VA Forms System Core will be a React library hosted in NPM that will allow engineers and designers to easily interact with Forms inside of vets-website.
const conditionalPath =
((current?.element as ReactElement)?.props as { type: string })
?.type === 'conditional';
instead of just checking for the existence of a conditional property:
const condition = (
(current?.element as ReactElement)?.props as { condition: string }
)?.condition;
RouterContext.tsx currently uses useField when you could probably hook into the Formik context to get the field value. Determine which method is least expensive, and change it if necessary:
const field = condition ? useField(condition) : null;
RouterContext
uses conditional path property (ln 33)instead of just checking for the existence of a conditional property:
const field = condition ? useField(condition) : null;