Maximum Call Stack Size Exceeded Error with slotProps in Storybook for TextField Component #45287
Labels
component: text field
This is the name of the generic UI component, not the React module!
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Steps to reproduce
Create a
InputField
component as shown below:Create a Storybook story for this component using slotProps for a password field with a toggle feature, similar to the code below:
Run Storybook and load the story (PasswordWithToggle) to trigger the error.
Observe the error: Upon loading the Storybook page for the PasswordWithToggle, you will see the error: Maximum call stack size exceeded.
Current behavior
When loading the Storybook page for the
PasswordWithToggle
story, the following error is triggered:This error occurs when trying to render the
InputField
component with theslotProps
for the password toggle functionality. The component does not render properly, and the page fails to load as expected.The issue seems related to the recursive nature of the component rendering process, as indicated by the "Maximum call stack size exceeded" error message. This prevents the component from being displayed correctly in Storybook.
I have tried adjusting the
slotProps
structure and ensuring proper usage of state in the story, but the error persists.Expected behavior
The
InputField
component with the password toggle functionality should render properly in Storybook without throwing any errors.endAdornment
should display a clickableIconButton
with either theVisibility
orVisibilityOff
icon, depending on whether the password is being shown or hidden.InputField
component correctly, with the password toggle functionality working as expected.Context
No response
Your environment
npx @mui/envinfo
Search keywords: TextField, React Storybook
The text was updated successfully, but these errors were encountered: