Getting empty CSV files after upgrading to React 18
kwalk2108 opened this issue · comments
Having the same issue
I resolved this issue by adding some logic and to check if the async data populating the CSV had finished downloading and added to the local state prop. Then I used a setTimeout to click the CSV link and open the file. It's not a pretty solution but seems to be getting the job done
The primary issue is with using createRoot
vs ReactDOM.render
. Switching between how the app is rendered is what triggers the mis-ordered data -- it is always 1 render behind.
The primary issue is with using
createRoot
vsReactDOM.render
. Switching between how the app is rendered is what triggers the mis-ordered data -- it is always 1 render behind.
Exactly this happened to my project. I got the warning https://reactjs.org/link/switch-to-createroot after an update, then applied the change and started having this problem.