fix(ui): form state infinite render (#11665)
The task queue triggers an infinite render of form state. This is because we return an object from the `useQueues` hook that is recreated on every render. We then use the `queueTask` function as an unstable dependency of the `useEffect` responsible for requesting new form state, ultimately triggering an infinite rendering loop. The fix is to stabilize the `queueTask` function within a `useCallback`. Adds a test to prevent future regression.
This commit is contained in:
@@ -12,6 +12,15 @@ export const PostsCollection: CollectionConfig = {
|
||||
name: 'title',
|
||||
type: 'text',
|
||||
},
|
||||
{
|
||||
name: 'renderTracker',
|
||||
type: 'text',
|
||||
admin: {
|
||||
components: {
|
||||
Field: './collections/Posts/RenderTracker.js#RenderTracker',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'validateUsingEvent',
|
||||
type: 'text',
|
||||
|
||||
Reference in New Issue
Block a user