Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save and Add Another example non-functional #7656

Closed
theMadness opened this issue May 7, 2022 · 0 comments · Fixed by #7709
Closed

Save and Add Another example non-functional #7656

theMadness opened this issue May 7, 2022 · 0 comments · Fixed by #7709

Comments

@theMadness
Copy link

What you were expecting:
Save and Add Another instructions to be functioning in the most basic example.

What happened instead:
When applying the instructions in the Save and Add another recipe of the Create component documentation, I get an error "can't access property "reset", useFormContext is null" or "react_hook_form__WEBPACK_IMPORTED_MODULE_2_.useFormContext() is null
"

Steps to reproduce:
Implement a create form exactly as instructed in the example of the Create component "Save and Add Another" recipe.

Related code:
https://codesandbox.io/s/blue-shadow-d9oinx?file=/src/posts/PostCreate.tsx

Sidenote, the base example does have a different candidate implementation, but in order to have the reset happening with the default submit button, it requires the onSuccess mutation to happen on the Create component, and there doesn't seem to be a way to access the context at that level. Please keep that in mind when providing an updated recipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants