Comments (7)
About what I just answered #779 (comment)
I think after some understanding that it's just a matter of doc π Also giving less possibility is also less confusing.
Without deprecating the feature or remove it, we could just omit it in the doc, as we can achieve the same goals in one syntax. So why present two (the first one is a bit more confusion as props are getting overrided in all case
I think you are 100% right on that, it's my fault of lack of documentation! I will improve it over this week or the weekend. Feel free to leave some suggestions as well, as we can improve this together.
from documentation.
About what I just answered #779 (comment)
I think after some understanding that it's just a matter of doc π Also giving less possibility is also less confusing.
Without deprecating the feature or remove it, we could just omit it in the doc, as we can achieve the same goals in one syntax. So why present two (the first one is a bit more confusion as props are getting overrided in all caseI think you are 100% right on that, it's my fault of lack of documentation! I will improve it over this week or the weekend. Feel free to leave some suggestions as well, as we can improve this together.
Don't blame yourself, it's already huge to have developed this, I love writing doc, I'll give some help (already did :p) and it's always better when someone that hasn't the full experience and background on the lib that give feedback as you have more information than I :p
from documentation.
To reduce confusion, only allows the <Controller as={Switch} /> syntax and remove the <Controller as={<Switch name="blabla" />} /> one, and always pass full props to that component ?
why there is a problem?
I see that the dependency has not been given.
I guess register and unregister should have name as deps, isn't? otherwise, we might experience a memory leak?
valid point. right now it's fine because useForm is handling all the cleanup
if (!fields[name]) { //only reigster field once
registerField();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
React.useEffect(() => () => unregister(name), []); // only run when component unmount
from documentation.
About what I just answered react-hook-form/react-hook-form#779 (comment)
I think after some understanding that it's just a matter of doc π Also giving less possibility is also less confusing.
Without deprecating the feature or remove it, we could just omit it in the doc, as we can achieve the same goals in one syntax. So why present two (the first one is a bit more confusion as props are getting overrided in all case
from documentation.
we should add name in the dep tho, which you are correctly. I am slowly waking up now heheh
from documentation.
Yea you are right! Thanks for contribution and all your feedbacks. They r really helpful not just for me and others after we improve the doc. I would love to see your avatar on our contribution list ;) so feel free send PR for things β€οΈπ
Letβs keep this issue open, we can discuss while we making improvement on the doc.
from documentation.
Just saw ur PR at the website. Awesome stuff approved and merged β€οΈ
from documentation.
Related Issues (20)
- Controlled/Uncontrolled confusion with UI libraries
- Controlled Checkbox array example
- YouTube video on React-Hook-Form HOT 1
- issue: DOC - Missing info about disabled property for field object (return section)
- issue: https://react-hook-form.com/api gives an empty page HOT 2
- issue: error in docs
- Issue: Documentation Discrepancy: Importing Material-UI Input in React Hook Form HOT 1
- Issue: Documentation link incorrect HOT 1
- Typo: "recommend" instead of "recommended"
- issue: Application error: a client-side exception has occurred (see the browser console for more information).
- Improve documentation for useWatch exact
- Update twitter icon HOT 2
- issue: useFieldArray Unable to track newly added elements When "shouldUnregister" is enabled HOT 1
- The `RegisterOptions` type does not match the documentation
- Document watch callback type parameter
- issue: In the specified sandbox environment, when the onChange event handler is invoked with undefined as its argument, the Component does not receive the updated value. However, despite this, the form data is successfully updated. HOT 4
- issue: maxLength does not limit input field to length HOT 1
- Two different documentation versions
- issue: Website appears as a blank background HOT 2
- Documentation: keepIsSubmitSuccessful missing from documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.