You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is a bug in useControlledSwitchWarning that will rendering two different warnings at the same time.
when the component goes from controlled to uncontrolled and,
when the component goes from uncontrolled to controlled.
I believe the first warning condition is incorrect. I would be happy to throw up a PR with the following change:
warning(!(isControlled&&!wasControlled),`\`${componentName}\` is changing from uncontrolled to be controlled. Reach UI components should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled \`${componentName}\` for the lifetime of the component. Check the \`${controlPropName}\` prop.`);
Hope I'm not missing something blatantly obvious 😓
The text was updated successfully, but these errors were encountered:
❓Question
I think there is a bug in
useControlledSwitchWarning
that will rendering two different warnings at the same time.I believe the first warning condition is incorrect. I would be happy to throw up a PR with the following change:
Hope I'm not missing something blatantly obvious 😓
The text was updated successfully, but these errors were encountered: