yocontra / react-responsive

CSS media queries in react - for responsive design, and more.
https://contra.io/react-responsive
MIT License
7.04k stars 298 forks source link

Support for PWA ? #249

Closed guivinson closed 4 years ago

guivinson commented 4 years ago

Do you think react-responsive could handle if a PWA has been installed or is it out-scope ?

https://stackoverflow.com/a/52695341

yocontra commented 4 years ago

You're talking about doing this <Responsive query="(display-mode: standalone)">? It should work fine as long as it is a valid media query. displayMode="standalone" for props mode or object mode should work fine as well, we don't do any actual validation of the queries we just decamelize -> CSS and pass it to matchMedia directly. Only basic proptype validation exists for common queries to help prevent mistakes: https://github.com/contra/react-responsive/blob/master/src/mediaQuery.js