<AutoForm schema={PostSchema} onSubmit={createPost} >
Create post method tries to use hooks. What I'm getting is:
Line 38: React Hook "useMutation" is called in function "createPost" which is neither a React function component or a custom React Hook function react-hooks/rules-of-hooks
Hi @wtrocki. Can you provide the whole code? I'm not sure what exactly is causing the problem.
I have tried to workaround it by passing client outside hooks.
https://github.com/aerogear/modern-appdev-workshop/blob/master/template/client/src/App.tsx#L28
Generally way to replicate it will be to try to use Forms with Apollo useMutation hook which is default. Use mutation requires people to have some logic within component code. I will try to restore hooks here and give you shout.
It would be great if you could provide a runnable example on CodeSandbox or something similar.
@radekmie Yep. Going to do it. DO you think it is possible to have some example folder that will contain graphql type? I would like to contribute that back
Examples of _what_ exactly? We do have docs and I'd rather see it there.
If you would like to contribute - feel free to do so. @wtrocki If you'll still encounter any issues - write them down here or file a new issue. I'm closing this.
I have started building custom example applications using uniforms on my private account now.
Hoping to have something like create-uniforms-app soon where it will create react application from scratch that has uniforms integrated with all best patterns. Thank you for all the useful hints that helped me to get canonical setup. Docs are one thing, but great user experience starts with hype and good tooling.
Most helpful comment
I have started building custom example applications using uniforms on my private account now.
Hoping to have something like create-uniforms-app soon where it will create react application from scratch that has uniforms integrated with all best patterns. Thank you for all the useful hints that helped me to get canonical setup. Docs are one thing, but great user experience starts with hype and good tooling.