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
In case anyone is wondering, "why on earth would you set open and defaultOpen to undefined?"...
The answer is interop with other languages targeting JS. For example, using ScalaJS with a Props facade type. When constructing an instance of Props, all of the factory/constructor arguments must be specified or defaulted to js.undefined, as there is no concept of an "unset" attribute.
At first glance, I think this will still pass tests and be backward compatible. In fact, we likely should've been treating undefined as not present to begin with.
Let's get a PR and see what happens. Note, the logic can be reduced to this as we only care that they are undefined, not that they are present at all:
Hey @levithomason and @DylanLukes I am looking to contribute. I am guessing this issue is still open and is needing to be done, so I would love to help! This is also my first open source contribution too.
jonmajorc
pushed a commit
to jonmajorc/Semantic-UI-React
that referenced
this issue
Apr 24, 2017
Steps
For any auto-controlled property
x
, set bothx
anddefaultX
toundefined
. For example,open
andvalue
inDropdown
.Expected Result
These values should be treated as if they are undefined/do not exist.
Actual Result
Warning:
Dropdown prop "open" is auto controlled. Specify either defaultOpen or open, but not both.
Version
0.68.0
Testcase
http://codepen.io/anon/pen/xdGPxz?editors=1111
Suggested Fix
Here in AutoControlledComponent.js, replace:
by
The text was updated successfully, but these errors were encountered: