Controlled to uncontrolled warning for `Enable globals from all environments`
Closed this issue · 4 comments
Warning in the console (start:webpack
version) after checking/unchecking Enable globals from all environments
:
backend.js:6 Warning: A component is changing a controlled input of type checkbox to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components
in input (created by Environments)
in label (created by Environments)
in div (created by Environments)
in div (created by Environments)
in div (created by Environments)
in div (created by Environments)
in Environments (created by Configuration)
in div (created by Configuration)
in div (created by Configuration)
in div (created by Configuration)
in div (created by Configuration)
in Configuration (created by App)
in div (created by App)
in div (created by App)
in App
It doesn't show for Enable all rules
Hi @mdjermanovic, thanks for this issue.
I'm not familiar with React-- what is the impact or potential impact of this issue? (Not saying it isn't worth fixing-- just trying to learn.)
In this case, I don't know if there's any real impact, since it's a stateless component. But in a component with state, this could lead to bugs because the value of the input could be out of sync with the component's state (and it's a fair assumption the author wants the value of the input to reflect the state because the component is changing it at some point).
Confirmed - PR fix incoming.
There is a small impact on the screen only: open this Demo Link (before the fix is merged) and then select & deselect all environments. The browser
env will stay checked on the screen, but false
internally (out of sync).
Same as it was with rules, but there was easier to spot this because the recommended rules were initially checked, while the envs are usually not, unless present in URL/local storage.
Thanks @kaicataldo and @mdjermanovic for the explanations!