-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix default values of selected/selectedGlyphImage #47
Conversation
Could we possibly also discuss this here? So basically what I am saying is that it might be better to pass |
Sorry, I didn’t see your update when merging your PR. I see the point in your suggestion, but I think that it might cause an issue. When using boolean attributes that default to false in JSX, it is common to be able to set the value to
I’m open to making a breaking change if it improves the developer experience, but I’m worried by it behaving strangely in a situation like this one. |
Thank you so much for your feedback! And indeed, that is a valid point. Although I personally never use this syntax. However React is taking care of this already as far as I know and does not pass a If you would however use
the value would be I know this is quite a edgy case and quite a made up problem, though rather a general question if this could improve the library maybe. From my point of view this is only an issue when making managed props unmanaged (solution already provided) or unmanaged props managed during the life cycle of a component (solution would be to make the default values undefined instead of their MapKit JS default value equivalent and unset undefined values with the solution already provided). If this is too made up and too far from real problems, let's just forget about this ... |
React will pass I tested how React behaves with checkboxes, because it is a similar case. It turns out that when changing For this reason, I think that it is better to keep the current behavior for |
Thank you so much for your feedback! I would like to note two things as a side note to keep in mind. Omitting a value and setting it to false, doesn't behave the same way if set on initial render. While a Also React does warn when making an uncontrolled value controlled. Not sure if we should consider implementing a similar warning maybe at some point.
Even more precise, React is behaving the exact same way on the inputs as our library currently does. It does actually not set it to |
See #38 (comment)