1

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.

sai laxmi
  • 11
  • 1
  • 2
  • 2
    as I know, in the web you cannot get deviceInfo or anything else. in React Native you can get it because it will be a native application. – Mohammad Sadegh Foroughi Jan 18 '21 at 05:44
  • 2
    https://www.npmjs.com/package/react-device-detect I don't think you can get a device ID, but you get a ton of other device information and details. – Drew Reese Jan 18 '21 at 06:07

1 Answers1

0

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.