How can one tell the version of React running at runtime in the browser?

前端 未结 12 1784
抹茶落季
抹茶落季 2020-12-12 23:07

Is there a way to know the runtime version of React in the browser?

12条回答
  •  情深已故
    2020-12-12 23:54

    For an app created with create-react-app I managed to see the version:

    1. Open Chrome Dev Tools / Firefox Dev Tools,
    2. Search and open main.XXXXXXXX.js file where XXXXXXXX is a builds hash /could be different,
    3. Optional: format source by clicking on the {} to show the formatted source,
    4. Search as text inside the source for react-dom,
    5. in Chrome was found: "react-dom": "^16.4.0",
    6. in Firefox was found: 'react-dom': '^16.4.0'

    The app was deployed without source map.

提交回复
热议问题