Conversation
Codecov Report
@@ Coverage Diff @@
## master #1086 +/- ##
=======================================
Coverage 81.78% 81.78%
=======================================
Files 702 702
Lines 8580 8580
Branches 1172 1245 +73
=======================================
Hits 7017 7017
Misses 1548 1548
Partials 15 15
Continue to review full report at Codecov.
|
| ...(p.size && toFlexItemSizeValues(v[p.size])), | ||
|
|
||
| ...(p.shrink && { flexShrink: p.shrink }), | ||
| ...(typeof p.shrink === 'number' && { flexShrink: p.shrink }), |
There was a problem hiding this comment.
I know this is already merged, sorry for not being able to review before that. However, there are a few things I'd like to mention.
1. what about the global values as string?
I think we should allow users to pass these too (see: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink#Syntax)

2. what about the true boolean value?
From the new code it looks like
<Flex.Item shrink>
{/* some element */}
</Flex.Item />will have no effect; to me that's not expected user behavior since the type of shrink prop is still boolean | number
There was a problem hiding this comment.
Let me start with the second question first - yes, this is exactly the effect you've described. The logic is correct as<Flex.Item shrink /> is, essentially, equivalent to <Flex.Item />, given that flex items are shrinkable by default (we've done it to correspond to CSS specs).
Speaking of the first question - we might want to introduce support for mentioned props later, but for now extra prop values from the scope of Flex component were omitted in order to achieve the following:
address as many scenarios with the least set of props/values necessary
Thus, might suggest to leave it as is for now and return to the question of introducing these prop values (or use another solution approaches) when there will be an appealing use case for that.
This PR introduces fix for
shrinkprop ofFlex.Itemcomponent. Previously value of0was improper interpreted, so that resulting flex item was remaining shrinkable even with this value provided