Check out example codes for "throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))". It will help you in understanding the concepts better.
Code Example 1
module.exports = router;
Learn ReactJs, React Native from akashmittal.com