module.exports

ReactNative 2017-04-10

module.exports

用来导入某个js文件中的某一个模块。

What you need is a way to import only a specific part of a file into another file.

The answer is something called module.exports.module.exports comes from Node.js's module system, just like require does.


 NOTE:Any component rendered by a different component must be included in module.exports.

Remember that every file is invisible to every other file, except for what you choose to expose via module.exports.
NavBar.js
<wiz_code_mirror>
</wiz_code_mirror>
module.exports=NavBar;加上后,
Now, when ProfilePage.js uses requireto import NavBar.js, it will get back exactly what it wants: the NavBar component class.

ProfilePage.js
<wiz_code_mirror>
</wiz_code_mirror>

 
 


本文由 方方無 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。

还不快抢沙发

添加新评论

shijiebei 365bet manbetx 188bet xinshui caipiao 95zz tongbaoyule beplay 88bifa 18luck betway bwin hg0088 aomenjinshayulecheng ca88 shenbotaiyangcheng vwin w88 weide