-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Improve documentatoin of linked inputs with FormDataConsumer #3113
Comments
I agree, though the docs are quite good already, a little more context would have helped a lot. This took some playing with for me as well, mostly to figure out what I had to protect against and when to expect components to update (but then again I am pretty new to React). I was overcomplicating it at first. It is just a form-level input change event. Maybe that should have been obvious but at first I was working to understand how it links components (it does not, technically, it just allows an indirect data dependency, right?) The pattern I've been using is to pull the member I want from formData, test if it is valid or default it, etc, and then pass that as a prop. The child component seems to only render when the value changes ( I am far from an advanced user here though so please read in that context. |
This request enters the gray area between pure documentation and recipes for a particular use case. I believe all the documentation necessary to achieve what you describe is already there (including I'm leaving this one open but I personally think that the answer belongs to StackOverflow. |
What is getCitiesFor doing? Can it actually be making an API call? |
HI, I am new to react-admin and also in ReactJs. I am stuck with a custom button. What I want to do is I have a user list when I click on the row it goes to the user edit page there I have a custom button and I want to edit some values and send it to the server. But in custom button I am using useUpdate and in custome button I am not able to get the form data which I edited. Please help |
Hi @Mohit-pratap, Please use StackOverflow with the |
For seasoned uses, I believe you are right. But if you are fairly fresh react-admin or relatively young on react patterns and principals you are going to have a tough time deriving the undocumented pattern from the (sometimes stale) documentation and the mental model you are supposed to combine from consuming the rest of the documentation. So since its a 'grey area', why not fill the gap? |
I am trying to link together 2 input fields with FormDataConsumer and ReferenceArrayInput/SelectArrayInput.
My code looks like this:
I used the Howto on your site (https://marmelab.com/react-admin/Inputs.html#linking-two-inputs) and of course Stackoverflow with all my questions I had.
I still miss something from the documentation, and if possible that would be great if it would be there.
Your example shows this for FormDataConsumer:
You are using a getCitiesFor function here which filters/collects/reaches out to another API endpoint/whatever - which is not visible.
I'd like to be more than happy if the getCitiesFor function would be in the examples as well, so we know how it is being used.
Would it be possible to provide that data?
The text was updated successfully, but these errors were encountered: