-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Reusable app hooks #1179
Reusable app hooks #1179
Conversation
View your CI Pipeline Execution ↗ for commit 7d9300e.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1179 +/- ##
==========================================
+ Coverage 88.50% 88.62% +0.11%
==========================================
Files 27 28 +1
Lines 1218 1248 +30
Branches 322 325 +3
==========================================
+ Hits 1078 1106 +28
- Misses 125 127 +2
Partials 15 15 ☔ View full report in Codecov by Sentry. |
This comment was marked as resolved.
This comment was marked as resolved.
Agreed @LeCarbonator. The idea will be that if you need to use ---
config:
look: handDrawn
---
flowchart TD
A["Do you need to reuse state (like defaultValues)?"]
A -- Yes --> B["Use 'formOptions()'"]
A -- No --> C["Do you need to reuse custom validation functions?"]
C -- Yes --> D["Wrap 'useForm' hook into a custom app hook"]
C -- No --> E["Do you need to reuse custom UI components?"]
E -- Yes --> F["Do you need access to the 'field'?"]
F -- Yes --> G["Use 'createFormHook''s 'fieldComponents'<br/>(EG: 'TextInput' and 'NumberInput')"]
F -- No --> H["Use 'createFormHook''s 'formComponents'<br/>(EG: 'SubmitButton')"]
E -- No --> I["Do you need to reuse whole subsections of your form?"]
I -- Yes --> J["Use 'withForm' from 'createFormHook'"]
I -- No --> K["Use 'form.Subscribe' and 'form.Field'"]
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
* fix: type unions should now work properly Co-authored-by: irwinarruda <[email protected]> * ci: apply automated fixes and generate docs * chore: reintroduce TDepth for infinate depth issues Co-authored-by: irwinarruda <[email protected]> * ci: apply automated fixes and generate docs * test: add large schema test --------- Co-authored-by: irwinarruda <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor suggestions and some typos. Looks good to me otherwise!
Note: This review only addresses the docs. I have not reviewed the code changes.
Co-authored-by: LeCarbonator <[email protected]>
# Conflicts: # pnpm-lock.yaml
This PR introduces three new APIs to help with:
form.Field
boilerplateAll without having to type cast any generic by hand.
The API, for React, is as such:
TODO
withField
anduseAppForm
APINotes