-
Notifications
You must be signed in to change notification settings - Fork 645
Closed
Labels
Description
The context prop on the Slots component generated by createSlots is marked as optional:
react/src/utils/create-slots.tsx
Line 31 in 2b5c86e
| context?: ContextProps['context'] |
However, not providing this prop causes an infinite render loop. The result will look fine, but a check of the console will show that it never stops rendering:
Error: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
This bug is really hard to figure out since there's no hints as to what causes the issue.
Even just setting the prop to an empty object (<Slots context={{}}>) fixes the problem.