[英]npm module to use both in a react.js project and in a react native project: how to define the different behaviour in the code?
Supposing to work in the index.js of the module, I should define something like假设在模块的 index.js 中工作,我应该定义类似的东西
if (we are in a react.js project){
do this;
} else if (we are in react native project){
do this;
}
how can I identify if the module is used in a reactjs project or in react native project?如何确定模块是在 reactjs 项目中还是在 react native 项目中使用?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.