Closed kylpo closed 7 years ago
One attempt:
<View
horizontal
alignHorizontal='left'
alignVertical='top'
spaceItems='between' | 'around' | 'evenly'
...
/>
Starts to break down there. Based on flex-direction, the spaceItems
value will override alignHorizontal
or alignVertical
, which is weird.
/shurg
Another idea from Thomas: remove alignHorizontal
and alignVertical
. Have View
function as Flex
is today. This means there'd also be no reason to have Col
, so Row
should go away, too (see the horizontal
prop above).
Pros: deletes code in monorepo, reduces components available, probably less to explain
Cons: lose the convenient align_
s, locked in to the association of View
using flexbox
, lose out on some context for skimming: View
, Col
, Row
, Flex
have distinct purposes that are easier to discover than a prop, but that might not be a big deal
<View
horizontal
align='flex-end' // or 'end' (and 'start' over 'flex-start')
justify='space-between'
...
/>
Another: let Col
and Row
use alignH|V
, with align
and justify
overrides
<Row
alignHorizontal='right'
alignVertical='bottom'
justify='space-between' // overrides alignHorizontal
...
/>
that way, alignH|V
is just a convenience prop for flex-start
, center
, flex-end
.
Pros: get to use alignH|V
Row and Col for the more common justify and aligns
Cons: confusion in how/why an alignH=right
is not honored. Muddies the boundaries more between the 4 components
justify
and align
in View and remove Col and Flex. Why even have Row then?ScrollView
if we could just add a scrollable
prop to View
?
ScrollView
are different enough to justify a new component. <View horizontal />
doesn't actually change the props available, it just modifies the effect of some of them (like align
).View
if it is actually more like a Col
?
row
. For now it is just defaulted to a col
.Flex
?
alignItems
or justifyContent
- it uses align
and justify
. It has conveniences like fit
and grow
. It may not use direction=
(it might use horizontal
instead).
Notes for how to solve or explain the case for View hiding its flexbox implementation with
alignHorizontal
andalignVertical
props vsalign
,justify
.Main problem for not using
alignHorizontal
andalignVertical
inFlex
,Col
,Row
is the existence ofjustify-content
'sspace-between
,space-around
,space-evenly
, andalign-items
'sbaseline
,stretch
. How to supportalignH/V
while still enabling those values?cc @thomasbruketta