You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a React component library with turbo monorepo using npm including a FieldBuilder that applies to Formik and the Field component.
I'm stuck because of an error.
formik.getFieldProps is not defined
The problem is the recovery of the formik context inside the library to be able to use the Field component.
Do you have a clue to recover the context?
Example for reproduce:
switch (field.component) {
case 'yourComponent':
// At this step is the problem= formik.getFieldProps is not defined
Field does not receive the Context because it's outside the project.
return <Field component={yourInnerComponentInsideYourLIb} {...yourCustomProps} />
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thank you for this library!
I created a React component library with turbo monorepo using npm including a FieldBuilder that applies to Formik and the Field component.
I'm stuck because of an error.
formik.getFieldProps is not defined
The problem is the recovery of the formik context inside the library to be able to use the Field component.
Do you have a clue to recover the context?
Example for reproduce:
switch (field.component) {
case 'yourComponent':
}
Tested with a next.js 13.3 version
Thanks
Beta Was this translation helpful? Give feedback.
All reactions