How to get DeviceInfo and DeviceId in React js web application Not React-Native Application

11.4k views Asked by At

I have Installed React-native-device-info API in my React js project. But when running npm start command in command prompt it was throwing error like " Module not found: Can't resolve 'react-native' in '\node_modules\react-native-device-info\lib\module' .

I have tried all the solutions on google. But the implementations are related to react-native applications only. I need some help how to get deviceinfo and deviceid for REACTJS web application.

1

There are 1 answers

0
alireza jalilian On

use the library => react-device-detect link : https://www.npmjs.com/package/react-device-detect

Detect device, and render view according to the detected device type.