Skip to content

Commit

Permalink
[core] Fix infinite loop in inline canvas mode (#3265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Mar 4, 2024
1 parent e5052ca commit c1a5a85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/toolpad-app/src/runtime/ToolpadApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,11 @@ function useApplicationVm(onUpdate: (registry: ApplicationVm) => void) {
if (scheduledUpdate) {
return;
}
scheduledUpdate = Promise.resolve().then(() => {
scheduledUpdate = Promise.resolve().then(async () => {
onUpdate(vm);
// We seem to be hitting https://github.com/facebook/react/issues/24650
// In the pageEditorReducer unless we schedule the next one in a new microtask
await Promise.resolve();
scheduledUpdate = undefined;
});
};
Expand Down

0 comments on commit c1a5a85

Please sign in to comment.