{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/2261","labels_url":"https://api.github.com/repos/facebook/react-native/issues/2261/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/2261/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/2261/events","html_url":"https://github.com/facebook/react-native/issues/2261","id":99680188,"number":2261,"title":"Require issue?","user":{"login":"broonage","id":7299904,"avatar_url":"https://avatars.githubusercontent.com/u/7299904?v=3","gravatar_id":"","url":"https://api.github.com/users/broonage","html_url":"https://github.com/broonage","followers_url":"https://api.github.com/users/broonage/followers","following_url":"https://api.github.com/users/broonage/following{/other_user}","gists_url":"https://api.github.com/users/broonage/gists{/gist_id}","starred_url":"https://api.github.com/users/broonage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broonage/subscriptions","organizations_url":"https://api.github.com/users/broonage/orgs","repos_url":"https://api.github.com/users/broonage/repos","events_url":"https://api.github.com/users/broonage/events{/privacy}","received_events_url":"https://api.github.com/users/broonage/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-07T16:14:40Z","updated_at":"2015-08-07T16:33:38Z","closed_at":null,"body":"I have some modules (non ui) which I'm using throughout my app.\r\n\r\nI have a structure like\r\n```\r\n/root/\r\n-index.ios.js\r\n-/app/\r\n--MyModule.js\r\n-/core/\r\n--MyModule2.js\r\n```\r\n\r\nWhen I refer to a module via index.ios.js, it works fine:\r\ne.g. \r\n```\r\nvar MyModule = require('./app/MyModule');\r\n...\r\nvar MyModule2 = require('./core/MyModule2');\r\n```\r\n\r\nIf I try to reference a module elsewhere (i.e. in the /apps/ folder, I have a reference from MyModule to MyModule2 which is in /core/), I have to put a full path with extension:\r\n```\r\nvar MyModule2 = require('MyApp/core/MyModule2.js');\r\n```\r\nI'm sure, after surfing google for answers yesterday, I had read something about this and require paths but I can't find where I read it! In any case I would like to structure my app, is it possible?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/128757958","html_url":"https://github.com/facebook/react-native/issues/2261#issuecomment-128757958","issue_url":"https://api.github.com/repos/facebook/react-native/issues/2261","id":128757958,"user":{"login":"jaygarcia","id":180031,"avatar_url":"https://avatars.githubusercontent.com/u/180031?v=3","gravatar_id":"","url":"https://api.github.com/users/jaygarcia","html_url":"https://github.com/jaygarcia","followers_url":"https://api.github.com/users/jaygarcia/followers","following_url":"https://api.github.com/users/jaygarcia/following{/other_user}","gists_url":"https://api.github.com/users/jaygarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/jaygarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaygarcia/subscriptions","organizations_url":"https://api.github.com/users/jaygarcia/orgs","repos_url":"https://api.github.com/users/jaygarcia/repos","events_url":"https://api.github.com/users/jaygarcia/events{/privacy}","received_events_url":"https://api.github.com/users/jaygarcia/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T16:33:38Z","updated_at":"2015-08-07T16:33:38Z","body":"I've found the need to use relative paths. *require('../SomeDir/SomeModule'). Works like a champ "}}