Closed juwonjeong closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 82.52%. Comparing base (
ef8be8e
) to head (cdbdc77
). Report is 2 commits behind head on release/4.9.x.develop.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Checklist
Issue Resolved / Feature Added
In https://github.com/enactjs/enact/pull/3238, we removed defaultProps and implemented this feature manually. After this implementation, if
undefined
is passed for a prop value, the prop value remainsundefined
. However, defaultProps(https://legacy.reactjs.org/docs/typechecking-with-proptypes.html#default-prop-values) sets prop value to default value whenundefined
value is passed for the prop.Resolution
Fix
Scroller
,VirtualList
andVirtualGridList
to set prop value to default value whenundefined
is passed for the prop valueAdditional Considerations
I checked React's defaultProps for falsy values(null, undefined, false, NaN, 0, -0, "") and found that it sets the prop value to its default value only when undefined is passed.
And it seems that React's defaultProps only checked
undefined
.Links
WRQ-31515
Comments