Row expanded to edit fail - TypeError: f.pauseValidation is not a function
See original GitHub issueWhat you were expecting: Expanded and show the edit form
What happened instead: exception throw TypeError: f.pauseValidation is not a function
Steps to reproduce: Click expanded in the row of the data grid
Related code:
function QEdit(props) {
return (
<Edit {...props}>
<SimpleForm form={`estimation_edit_33`}>
<TextInput source="status" />
</SimpleForm>
</Edit>
);
}
export function OList(props) {
return (
<List pagination={<GlobalPagination />} {...props} filters={<OFilter />}>
<Datagrid rowClick="expand" expand={<QEdit />}>
Environment
- React-admin version: 3.2.2
- Last version that did not exhibit the issue (if applicable):2.9.6
- React version:16.9.0
- Browser: Chrome
- Stack trace (in case of a JS error):
react-final-form.es.js:175 Uncaught TypeError: f.pauseValidation is not a function
at react-final-form.es.js:175
at useConstant (react-final-form.es.js:67)
at ReactFinalForm (react-final-form.es.js:172)
at renderWithHooks (react-dom.development.js:16317)
at mountIndeterminateComponent (react-dom.development.js:18800)
at beginWork$1 (react-dom.development.js:20149)
at HTMLUnknownElement.callCallback (react-dom.development.js:337)
at Object.invokeGuardedCallbackDev (react-dom.development.js:386)
at invokeGuardedCallback (react-dom.development.js:439)
at beginWork$$1 (react-dom.development.js:25768)
at performUnitOfWork (react-dom.development.js:24682)
at workLoopSync (react-dom.development.js:24658)
at performSyncWorkOnRoot (react-dom.development.js:24247)
at react-dom.development.js:12285
at unstable_runWithPriority (scheduler.development.js:701)
at runWithPriority$2 (react-dom.development.js:12231)
at flushSyncCallbackQueueImpl (react-dom.development.js:12280)
at flushSyncCallbackQueue (react-dom.development.js:12268)
at discreteUpdates$1 (react-dom.development.js:24401)
at discreteUpdates (react-dom.development.js:1439)
at dispatchDiscreteEvent (react-dom.development.js:5914)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Custom Forms and UI for related records - f.pauseValidation is ...
What you were expecting: The custom form show. What happened instead: f.pauseValidation is not a function is throw.
Read more >Overview - Joe Sandbox
Source: bizible[1].js.3.dr, Binary or memory string: document.visibilityState&&/visible/i.test(document.visibilityState)&&e()},this)};f.
Read more >Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError - Some selector is not a function - jQuery is not a function - owlCarousel...
Read more >uncaught typeerror: (0 , react__ ...
When trying to edit a record I get the Error "navigator.block is not a function". Steps to reproduce: 1- User the Form Component...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have managed to(at least partially) make it working by completely removing
form
prop. The issue than is that when you try updating one record during undoable delay after updating another record - it does not apply the update.undoable={false}
helps here. However, this is still just a workaroundThe issue is:
Therefore, the example above is broken, because it’s passing a string (intended to be the form ID) but this needs to be a FormApi instance.
This also shows up in the documented example at https://marmelab.com/react-admin/List.html. Search for the comment “The form must have a name dependent on the record, because by default all forms have the same name”.
I don’t know what the intended APIs are at all the layers, so I don’t know where the form ID vs FormApi confusion has happened. I was able to work around this as below, but I don’t know if this is going to work properly once I have multiple forms on the page.