react-native-device-detection icon indicating copy to clipboard operation
react-native-device-detection copied to clipboard

function maybe better than class

Open geminiyellow opened this issue 7 years ago • 2 comments

hi @m0ngr31 thanks for your great work.

but you know, when somebody use react-native-web, like me, hope detect the device type when resize window. so, a function, check current screen/window size , maybe better than now, only check once when init the library.

geminiyellow avatar Oct 23 '18 07:10 geminiyellow

Even in react-native, if the device changes orientation, width and height do not update. Dimensions have an addEventListener method that fires every time a property of "window" or "screen" changes. It could be used to guarantee that width and height are always correct.

Fsarmento avatar Feb 21 '19 10:02 Fsarmento

I just wrote a proof of concept: #14

Let me know if you think that'd work.

m0ngr31 avatar Jan 16 '20 18:01 m0ngr31