{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/48526310","id":48526310,"diff_hunk":"@@ -1,41 +1,40 @@\n > * 原文链接 : [Things I Wish I Were Told About React Native](http://ruoyusun.com/2015/11/01/things-i-wish-i-were-told-about-react-native.html)\n * 原文作者 : [Ruoyu Sun](https://twitter.com/insraq)\n * 译文出自 : [掘金翻译计划](https://github.com/xitu/gold-miner)\n-* 译者 : \n+* 译者 : [huanglizhuo](https://github.com/huanglizhuo) \n * 校对者: \n-* 状态 :  待定\n+* 状态 :  翻译结束\n \n-## No. 1 (Really) Read The Document\n+## No. 1 读文档（一定要读）\n+  1   我之所以把它列在第一位是因为这真的是最节省时间的一条。等你真正读了文档，尤其是[\"指导\"](https://facebook.github.io/react-native/docs/style.html#content)这节，读完后你就知道下面 tips 中的绝大部分了。但人们更喜欢在实践中学习-这也是我之前做的。我浪费的大把的时间在下面的事情上，而不是读文档。因此我希望我的列表可以节约你的时间。\n \n-I list this as first one because it is the single most important time saver. After you really read the document, especially the [“Guide”](https://facebook.github.io/react-native/docs/style.html#content) section, you should already know most of the tips below. But I know people prefer to learn by doing these days - and that’s exactly what I have done. I have wasted hours and hours on some of the things below without reading the documents. So I hope this list can save you some time.\n+## No. 2 查看并运行 UIExplorer  项目\n \n-## No.2 Checkout and Run the Official UIExplorer Project\n+  React Native 文档没有快速演示（由于框架天生原因）或者是 UI 组件和 API 的截图。因此弄清楚每个组件的样子有些困难。这就是他们为什么提供了这个非常有用的 [UIExplorer Project](https://github.com/facebook/react-native/tree/master/Examples/UIExplorer)项目。它真的可以节省你很多猜测和尝试的时间。\n \n-React Native documents does not have live examples (due to its nature) or screenshots of its UI Component and APIs. Therefore it could be a bit difficult to figure out what each Component does. That’s why React Native provides the useful [UIExplorer Project](https://github.com/facebook/react-native/tree/master/Examples/UIExplorer). It could truly save you lots of time guessing and poking around.\n+## NO. 3 选择合适的导航组件\n \n-I have to admit, I have wasted lots of time porting my code from `NavigatorOS` to `Navigator` and back. Actually React Native has a pretty [detailed comparison](https://facebook.github.io/react-native/docs/navigator-comparison.html) of those two, which I did not read before I dive in. In short, NavigatorIOS has a slightly more native feel but is quite buggy, less supported and has limited API.\n+  我不得不承认我浪费了大量的时间在把我的代码从`NavigatorOS` 和  `Navigator` 之间来回切换 。事实React Native 提供了相当 [ 详细的对比](https://facebook.github.io/react-native/docs/navigator-comparison.html) ,当然在我把时间浪费之前我也没读过它。一句话来说就是 NavigatorOS 更像原生的组件，但提供了有限的 API 并且 bug 比较多。\n \n-## No. 4 You Code Does Not Run on Node.JS\n+## No. 4 你的代码不是运行在 nodejs 上的\n \n-The JavaScript runtime you’ve got is ether JavaScriptCore (non-debug) or V8 (debug). Even though you can use NPM and a node server is running on the background, your code does not actually run on Node.JS. So you won’t be able to use of the Node.JS packages. A typical example is `jsonwebtoken`, which uses NodeJS’s crypto module.\n+  你的 javascript 要么是 JavaScriptCore（不支持 dubug） 要么是 V8 （可以 dbug）。尽管你用 NPM 并且 node server 在后台运行，你的代码并不是真正运行在 nodejs 上的。因此是不可以使用 NodeJs 包的。一个典型的例子就是`jsonwebtoken`，它用了 NodeJs 的加密模块。\n \n-## No. 5 Push Notification is Tricky\n+## No. 5 推送通知很不靠谱\n \n-Push notification in React Native is tricky. It should work in 0.13, but you will need to set up your project in Xcode (Add Library, Add header files) etc. The official document is quite brief. In v0.12 or below, it does not even work on later iOS versions. You will need to do some patching. [This article](https://medium.com/@DannyvanderJagt/how-to-use-push-notifications-in-react-native-41e8b14aadae#.66tv809um) is incredibly useful.\n+  在 React Native 中推送通知很不靠谱。这项特性是在 0.13 版上可以使用的，但你得在你的 Xcode 工程中设置（添加库，添加头文件等等）。官方文档相当简明。在 0.12 版或者之前的版本中甚至对后来的 IOS  版本不支持。你需要自己打补丁。这篇[文章](https://medium.com/@DannyvanderJagt/how-to-use-push-notifications-in-react-native-41e8b14aadae#.66tv809um)相当有用。","path":"TODO/things-i-wish-i-were-told-about-react-native.md","position":36,"original_position":36,"commit_id":"26ff60128bf3e8821a5b5c02552e6cd4e9af4775","original_commit_id":"26ff60128bf3e8821a5b5c02552e6cd4e9af4775","user":{"login":"aleen42","id":9573300,"avatar_url":"https://avatars.githubusercontent.com/u/9573300?v=3","gravatar_id":"","url":"https://api.github.com/users/aleen42","html_url":"https://github.com/aleen42","followers_url":"https://api.github.com/users/aleen42/followers","following_url":"https://api.github.com/users/aleen42/following{/other_user}","gists_url":"https://api.github.com/users/aleen42/gists{/gist_id}","starred_url":"https://api.github.com/users/aleen42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleen42/subscriptions","organizations_url":"https://api.github.com/users/aleen42/orgs","repos_url":"https://api.github.com/users/aleen42/repos","events_url":"https://api.github.com/users/aleen42/events{/privacy}","received_events_url":"https://api.github.com/users/aleen42/received_events","type":"User","site_admin":false},"body":"before|after\r\n在 React Native 中推送通知很不靠谱。这项特性是在 0.13 版上可以使用的，但你得在你的 Xcode 工程中设置（添加库，添加头文件等等）。| 在 React Native 中推送通知是很不靠谱的。虽然，在 0.13 版本以及以上版本是能有效使用，但是你必须在 Xcode 配置好你的项目（添加库，添加头文件等等）。\r\n官方文档相当简明。在 0.12 版或者之前的版本中甚至对后来的 IOS  版本不支持。你需要自己打补丁。|官方文档对于这点只是作出简要说明。在 0.12版本以及更旧版本上，对于后来的 IOS 版本来说，推送消息是不曾有效工作的。","created_at":"2015-12-29T08:12:52Z","updated_at":"2015-12-29T08:12:52Z","html_url":"https://github.com/xitu/gold-miner/pull/51#discussion_r48526310","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/48526310"},"html":{"href":"https://github.com/xitu/gold-miner/pull/51#discussion_r48526310"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/51","id":54593349,"html_url":"https://github.com/xitu/gold-miner/pull/51","diff_url":"https://github.com/xitu/gold-miner/pull/51.diff","patch_url":"https://github.com/xitu/gold-miner/pull/51.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/51","number":51,"state":"open","locked":false,"title":"这个点提交也是醉了 😊","user":{"login":"huanglizhuo","id":3874324,"avatar_url":"https://avatars.githubusercontent.com/u/3874324?v=3","gravatar_id":"","url":"https://api.github.com/users/huanglizhuo","html_url":"https://github.com/huanglizhuo","followers_url":"https://api.github.com/users/huanglizhuo/followers","following_url":"https://api.github.com/users/huanglizhuo/following{/other_user}","gists_url":"https://api.github.com/users/huanglizhuo/gists{/gist_id}","starred_url":"https://api.github.com/users/huanglizhuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huanglizhuo/subscriptions","organizations_url":"https://api.github.com/users/huanglizhuo/orgs","repos_url":"https://api.github.com/users/huanglizhuo/repos","events_url":"https://api.github.com/users/huanglizhuo/events{/privacy}","received_events_url":"https://api.github.com/users/huanglizhuo/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-25T21:08:06Z","updated_at":"2015-12-29T08:12:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e4bcc2fd1e8735cb9ece4bcbf8bcee233c0bd63","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/51/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/51/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/51/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/26ff60128bf3e8821a5b5c02552e6cd4e9af4775","head":{"label":"huanglizhuo:master","ref":"master","sha":"26ff60128bf3e8821a5b5c02552e6cd4e9af4775","user":{"login":"huanglizhuo","id":3874324,"avatar_url":"https://avatars.githubusercontent.com/u/3874324?v=3","gravatar_id":"","url":"https://api.github.com/users/huanglizhuo","html_url":"https://github.com/huanglizhuo","followers_url":"https://api.github.com/users/huanglizhuo/followers","following_url":"https://api.github.com/users/huanglizhuo/following{/other_user}","gists_url":"https://api.github.com/users/huanglizhuo/gists{/gist_id}","starred_url":"https://api.github.com/users/huanglizhuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huanglizhuo/subscriptions","organizations_url":"https://api.github.com/users/huanglizhuo/orgs","repos_url":"https://api.github.com/users/huanglizhuo/repos","events_url":"https://api.github.com/users/huanglizhuo/events{/privacy}","received_events_url":"https://api.github.com/users/huanglizhuo/received_events","type":"User","site_admin":false},"repo":{"id":48583226,"name":"gold-miner","full_name":"huanglizhuo/gold-miner","owner":{"login":"huanglizhuo","id":3874324,"avatar_url":"https://avatars.githubusercontent.com/u/3874324?v=3","gravatar_id":"","url":"https://api.github.com/users/huanglizhuo","html_url":"https://github.com/huanglizhuo","followers_url":"https://api.github.com/users/huanglizhuo/followers","following_url":"https://api.github.com/users/huanglizhuo/following{/other_user}","gists_url":"https://api.github.com/users/huanglizhuo/gists{/gist_id}","starred_url":"https://api.github.com/users/huanglizhuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huanglizhuo/subscriptions","organizations_url":"https://api.github.com/users/huanglizhuo/orgs","repos_url":"https://api.github.com/users/huanglizhuo/repos","events_url":"https://api.github.com/users/huanglizhuo/events{/privacy}","received_events_url":"https://api.github.com/users/huanglizhuo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/huanglizhuo/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":true,"url":"https://api.github.com/repos/huanglizhuo/gold-miner","forks_url":"https://api.github.com/repos/huanglizhuo/gold-miner/forks","keys_url":"https://api.github.com/repos/huanglizhuo/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/huanglizhuo/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/huanglizhuo/gold-miner/teams","hooks_url":"https://api.github.com/repos/huanglizhuo/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/huanglizhuo/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/huanglizhuo/gold-miner/events","assignees_url":"https://api.github.com/repos/huanglizhuo/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/huanglizhuo/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/huanglizhuo/gold-miner/tags","blobs_url":"https://api.github.com/repos/huanglizhuo/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/huanglizhuo/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/huanglizhuo/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/huanglizhuo/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/huanglizhuo/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/huanglizhuo/gold-miner/languages","stargazers_url":"https://api.github.com/repos/huanglizhuo/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/huanglizhuo/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/huanglizhuo/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/huanglizhuo/gold-miner/subscription","commits_url":"https://api.github.com/repos/huanglizhuo/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/huanglizhuo/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/huanglizhuo/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/huanglizhuo/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/huanglizhuo/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/huanglizhuo/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/huanglizhuo/gold-miner/merges","archive_url":"https://api.github.com/repos/huanglizhuo/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/huanglizhuo/gold-miner/downloads","issues_url":"https://api.github.com/repos/huanglizhuo/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/huanglizhuo/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/huanglizhuo/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/huanglizhuo/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/huanglizhuo/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/huanglizhuo/gold-miner/releases{/id}","created_at":"2015-12-25T14:41:27Z","updated_at":"2015-12-25T14:35:55Z","pushed_at":"2015-12-28T10:23:06Z","git_url":"git://github.com/huanglizhuo/gold-miner.git","ssh_url":"git@github.com:huanglizhuo/gold-miner.git","clone_url":"https://github.com/huanglizhuo/gold-miner.git","svn_url":"https://github.com/huanglizhuo/gold-miner","homepage":"http://gold.xitu.io","size":265,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xitu:master","ref":"master","sha":"dfdac480fdd063b9b1fe19cda0fc90200126c49c","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","created_at":"2015-11-04T03:29:13Z","updated_at":"2015-12-29T06:44:37Z","pushed_at":"2015-12-29T04:40:26Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"http://gold.xitu.io","size":489,"stargazers_count":94,"watchers_count":94,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":27,"forks":40,"open_issues":27,"watchers":94,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/51"},"html":{"href":"https://github.com/xitu/gold-miner/pull/51"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/51"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/26ff60128bf3e8821a5b5c02552e6cd4e9af4775"}}}}