标签: javascript reactjs react-native
我正在研究一个React组件,它需要知道它是在ReactJS还是React-Native环境中运行
我想创建这样的东西:
/MyComponent /index.js // Imports native.js or web.js based on the environment /native.js /web.js
有没有办法做这样的事情?