<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sandra Lundgren</title>
    <description>The latest articles on DEV Community by Sandra Lundgren (@sandralundgren).</description>
    <link>https://dev.to/sandralundgren</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F109831%2F148485b7-544b-4d05-8c00-46f9f7ae7f9f.jpeg</url>
      <title>DEV Community: Sandra Lundgren</title>
      <link>https://dev.to/sandralundgren</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sandralundgren"/>
    <language>en</language>
    <item>
      <title>React Native Troubleshooting Tips</title>
      <dc:creator>Sandra Lundgren</dc:creator>
      <pubDate>Thu, 06 Dec 2018 10:32:20 +0000</pubDate>
      <link>https://dev.to/sandralundgren/react-native-tips-nek</link>
      <guid>https://dev.to/sandralundgren/react-native-tips-nek</guid>
      <description>

&lt;p&gt;This list of tips is a work in progress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip # 1: Metro Bundler errors&lt;/strong&gt;, such as &lt;code&gt;ENOENT: no such file or directory, uv_cwd&lt;/code&gt;&lt;br&gt;
&lt;code&gt;jest-haste-map: watch error&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;jest-haste-map: watch error:&lt;br&gt;
  Error: EISDIR: illegal operation on a directory, read at Object.fs.readSync (fs.js:690:18)...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It's a good idea to keep an eye on the terminal running the Metro Bundler as a lot of errors - in particular bundling and syntax errors - will show up there. &lt;/p&gt;

&lt;p&gt;To fix the jest-hast-map or uv_cwd error and most of other problems not syntax-related run the commands&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ killall node&lt;/code&gt; &lt;br&gt;
(This command kills all node processes so it's admittedly a bit overkill, the Metro Bundler process is the one you want to kill, and by default the Metro Bundler runs on port 8081)&lt;br&gt;
&lt;code&gt;$ rm -rf ios/build/ &amp;amp;&amp;amp; react-native run-ios&lt;/code&gt;&lt;br&gt;
Removes the iOS build first and then runs the iOS simulator again.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ killall node&lt;/code&gt; &lt;br&gt;
&lt;code&gt;$ react-native run-ios&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip # 2 Unrecognized font family 'fontcustom' fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ react-native link&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You might need to specify the package name to link.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip # 3: fix laggy iOS simulator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The React Native iOS simulator can get very slow, so slow that even opening the dev tools menu has a very noticeable lag. &lt;br&gt;
If you are having this problem you should check that "Toggle Slow Animations" is not activated. &lt;br&gt;
In the iOS simulator, click on "Debug" -&amp;gt; "Toggle Slow Animations" should be unchecked. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip # 4: fix XCode's 'App installation failed -&lt;br&gt;
The maximum number of apps for free development profiles has been reached.'&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Delete some apps that you have installed using the same profile from your device.&lt;br&gt;
Go to "Window -&amp;gt; Devices and Simulators". &lt;br&gt;
Then delete any apps in the INSTALLED APPS section. &lt;br&gt;
Clean the project in XCode by using the SHIFT + cmd + K and try to build the project to iPhone again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip # 5: XCode's shows "No Filter Results" in the project navigator view&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to "Navigate &amp;gt; Reveal in Project Navigator".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip # 6: Fix 99% of weird problems&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Delete the app in the simulator. &lt;br&gt;
Close the simulator.&lt;br&gt;
Run all or a combination of the following commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ kill $(lsof -t -i:8081)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Stops the Metro Bundler.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ rm -rf ios/build/&lt;/code&gt; &lt;br&gt;
&lt;code&gt;$ watchman watch-del-all&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ rm -rf node_modules/&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npm start -- --reset-cache&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npm install&lt;/code&gt; &lt;br&gt;
&lt;code&gt;$ react-native run-ios&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;**Tip # 7: &lt;del&gt;Fix&lt;/del&gt; "“blurTextInput” &lt;del&gt;is deprecated&lt;/del&gt;": un-deprecated in v0.58&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import { Keyboard } from 'react-native';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;TextInput&lt;br&gt;
  ...&lt;br&gt;
  onBlur={Keyboard.dismiss()}&lt;br&gt;
 /&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Correction: it appears that “blurTextInput” was deprecated and then un-deprecated in v0.58. Read more about it &lt;a href="https://github.com/facebook/react-native/commit/476a831ea09c25d0bbcb97a536c5bef76a1c8273#diff-b48972356bc8dca4a00747d002fc3dd5"&gt;on React Native's repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;** Tip # 8: Unwanted black borders on iPad simulator &lt;/p&gt;

&lt;p&gt;In XCode's Project settings, go to the General tab.&lt;br&gt;
Then go to the "Build Settings" tab. &lt;br&gt;
In the search bar, type "Targeted Device Family". &lt;br&gt;
Select "1,2".&lt;br&gt;
Rebuild.&lt;/p&gt;


</description>
      <category>reactnative</category>
    </item>
  </channel>
</rss>
