marudy / react-native-responsive-screen

Make React Native views responsive for all devices with the use of 2 simple methods
MIT License
1.55k stars 140 forks source link

[Feature request] breakpointGroup to return a number instead of strings #159

Closed ErionTp closed 3 months ago

ErionTp commented 3 months ago

Hello,

Nice work on this repository.

I would suggest that the const { breakpointGroup } = useResponsive(); hook returns just a number instead of a string (group1, group2 ...) so, for example, we can use it like this: flexDirection = breakpointGroup > 4 ? "row" : "column"

For the moment I'm using it like this:

const screenSize = ["group1", "group2", "group2", "group3", "group4", "group5", "group6"];
const { breakpointGroup } = useResponsive();
flexDirection: screenSize.indexOf(breakpointGroup) > 4 ? "row" : "column"

thank you