Search code examples
cssreactjsstackbootstrap-5react-bootstrap

Which one is better? Stack direction="horizontal" or display flex in react bootstrap


I think the two functions are the same, but I mostly use display flex instead of Stack in react boostrap because it's more flexible in spacing objects.

Can anyone explain in more detail about this?


Solution

  • Well you can consider display flex as the better solution because in the stack direction you will need to re-create the stacks if the view port is changed where else in display flex you can give flex-wrap:wrap; and it will automatically adjust the flow.