0

I need to render views based on device in react {not native react} because to improve performance.

The design requirement is something that I cannot use same markup for all device like [desktop, tablet and mobile] and I need to separate desktop view and Tablet/Mobile view.

Having said that I want to boost performance and I don't want to render all the markup for both views. I need to render only that particular HTML markup which is required to that particular device.

Apart from Media queries do we have any way to render markup based on device.

Please note I would need this for react not native react

Abhishek Jain
  • 285
  • 1
  • 3
  • 12

1 Answers1

0

Short answer:Not possible.

You can only access limited information, might want to check: How to detect my browser version and operating system using JavaScript?

All the other frameworks (react-native, cordova) take this information directly from the OS, browsers do not allow you to do this.

Community
  • 1
  • 1
Oscar Franco
  • 5,691
  • 5
  • 34
  • 56