Fix warning for boolean props #1630
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
Overview of changes:
Resolves #1628.
Add
Stringtype to Boolean props with default value oftrue. This is because HTML attribute value is passed asString.In this case,
falsewill be rendered asString:In this case,
minimizedwill be passed asBoolean:Anything you'd like to highlight / discuss:
Should we add
Stringtype to all Boolean props that are from HTML attributes? Currently I only see the need for props with default value oftrueas the only way to set it tofalseas a HTML attribute is to pass a"false"value.However, if a user input this,
minimized will be rendered as
String. Not sure if the above example is the correct usage of HTML in general. Should we leave this to the user such that if they want an attribute to be true, just include the attribute there without any value? The above example of passing atruevalue will trigger warning unless we includeStringtype for allBooleanprops coming from HTML.Testing instructions:
Follow steps in #1628.
Proposed commit message: (wrap lines at 72 characters)
Fix warning for Boolean props
Checklist: ☑️