You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/entwine/UploadField/UploadFieldEntwine.js defines how entwine hooks result in the react UploadField being added to the DOM.
It includes a deprecated use of ReactDOM.render() in its refresh() function.
This was necessary because replacing it with the new React 18 createRoot() syntax resulted in an infinite loop any time a form in the CMS was submitted which included changes to the value of an UploadField (e.g. add a file and then save page, or remove file and then save page).
Worth noting here that the form submission did work correctly - refreshing the page shows the new value. So it's purely a react rendering issue after the submission has occurred - possibly some race condition between react and entwine.
Replace the ReactDOM.render() syntax with createRoot(), and refactor whatever needs refactoring to avoid the infinite loop on form submissions.
Acceptance Criteria
We don't use the deprecated ReactDOM.render()
The upload field works correctly in entwine forms
Forms submit correctly when saving changes to upload fields
The text was updated successfully, but these errors were encountered:
silverstripe/silverstripe-admin#1312 involved updating a lot of code, but some work was left undone.
src/entwine/UploadField/UploadFieldEntwine.js
defines how entwine hooks result in the reactUploadField
being added to the DOM.It includes a deprecated use of
ReactDOM.render()
in itsrefresh()
function.This was necessary because replacing it with the new React 18
createRoot()
syntax resulted in an infinite loop any time a form in the CMS was submitted which included changes to the value of anUploadField
(e.g. add a file and then save page, or remove file and then save page).Worth noting here that the form submission did work correctly - refreshing the page shows the new value. So it's purely a react rendering issue after the submission has occurred - possibly some race condition between react and entwine.
Replace the
ReactDOM.render()
syntax with createRoot(), and refactor whatever needs refactoring to avoid the infinite loop on form submissions.Acceptance Criteria
ReactDOM.render()
The text was updated successfully, but these errors were encountered: