Nick Allen Nick Allen - 4 months ago 10
Node.js Question

How does React Native require(moduleName) work?

I saw code like

var Animated = require('Animated')
in react-native source code. But how can this be resolved without a path ?

My guess is that will be preprocessed by the packager by something like registering and I would like to do this in my own project. But there seems to be no document for react-native's packager , and I can't find the source code where this "registering" happen.


I think I find it ! issue 896 , just add @providesModule moduleName in the file's comment in the header.