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

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

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

12条回答
  •  無奈伤痛
    2020-12-12 23:46

    With the React Devtools installed you can run this from the browser console:

    __REACT_DEVTOOLS_GLOBAL_HOOK__.renderers.forEach(r => console.log(`${r.rendererPackageName}: ${r.version}`))
    

    Which outputs something like:

    react-dom: 16.12.0
    

提交回复
热议问题