mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Deploy website - based on eb640f3660285bc7758946cf2ef2a3ee3f6fb760
This commit is contained in:
1 parent
cc688aff14
commit
820fc7b874
1773 files changed
+7447
-7447
No files matched your search
+4
-4
@@ -18,8 +18,8 @@
|
||||
<script src="https://snack.expo.io/embed.js" defer="defer"></script><title data-react-helmet="true">Debugging · React Native</title><meta data-react-helmet="true" property="twitter:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" name="twitter:image:alt" content="Image for React Native"><meta data-react-helmet="true" name="docsearch:language" content="en"><meta data-react-helmet="true" name="docsearch:version" content="0.63"><meta data-react-helmet="true" name="docsearch:docusaurus_tag" content="docs-default-0.63"><meta data-react-helmet="true" property="og:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" name="twitter:card" content="summary"><meta data-react-helmet="true" name="twitter:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" property="og:title" content="Debugging · React Native"><meta data-react-helmet="true" name="description" content="Accessing the In-App Developer Menu"><meta data-react-helmet="true" property="og:description" content="Accessing the In-App Developer Menu"><meta data-react-helmet="true" property="og:url" content="https://reactnative.dev/docs/debugging"><link data-react-helmet="true" rel="shortcut icon" href="/img/favicon.ico"><link data-react-helmet="true" rel="preconnect" href="https://BH4D9OD16A-dsn.algolia.net" crossorigin="anonymous"><link data-react-helmet="true" rel="canonical" href="https://reactnative.dev/docs/debugging"><link rel="stylesheet" href="/styles.fccefeba.css">
|
||||
<link rel="stylesheet" href="/main.ca40cabd.css">
|
||||
<link rel="preload" href="/styles.07d522c6.js" as="script">
|
||||
<link rel="preload" href="/runtime~main.41b9ecdd.js" as="script">
|
||||
<link rel="preload" href="/main.ac9e401f.js" as="script">
|
||||
<link rel="preload" href="/runtime~main.56c3f166.js" as="script">
|
||||
<link rel="preload" href="/main.5a3c9855.js" as="script">
|
||||
<link rel="preload" href="/1.ba9ce8bd.js" as="script">
|
||||
<link rel="preload" href="/2.58cb5d3d.js" as="script">
|
||||
<link rel="preload" href="/1f391b9e.a824c215.js" as="script">
|
||||
@@ -34,8 +34,8 @@
|
||||
</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// Ignore log notification by message:</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">LogBox</span><span class="token punctuation" style="color:#657b83">.</span><span class="token function" style="color:#79b6f2">ignoreLogs</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">[</span><span class="token string" style="color:#8dc891">'Warning: ...'</span><span class="token punctuation" style="color:#657b83">]</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain" style="display:inline-block">
|
||||
</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// Ignore all log notifications:</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">LogBox</span><span class="token punctuation" style="color:#657b83">.</span><span class="token function" style="color:#79b6f2">ignoreAllLogs</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span></div></div></div></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="unhandled-errors"></a>Unhandled Errors<a aria-hidden="true" tabindex="-1" class="hash-link" href="#unhandled-errors" title="Direct link to heading">#</a></h3><p>Unhanded JavaScript errors such as <code>undefined is not a function</code> will automatically open a full screen LogBox error with the source of the error. These errors are dismissable and minimizable so that you can see the state of your app when these errors occur, but should always be addressed.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="syntax-errors"></a>Syntax Errors<a aria-hidden="true" tabindex="-1" class="hash-link" href="#syntax-errors" title="Direct link to heading">#</a></h3><p>Syntax errors will automatically open a full screen LogBox error with the source of the syntax error. This error is not dismissable because it represents invalid JavaScript execution that must be fixed before continuing with your app. To dismiss these errors, fix the syntax error and either save to automatically dismiss (with Fast Refresh enabled) or cmd+r to reload (with Fast Refresh disabled).</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="chrome-developer-tools"></a>Chrome Developer Tools<a aria-hidden="true" tabindex="-1" class="hash-link" href="#chrome-developer-tools" title="Direct link to heading">#</a></h2><p>To debug the JavaScript code in Chrome, select "Debug JS Remotely" from the Developer Menu. This will open a new tab at <a href="http://localhost:8081/debugger-ui" target="_blank" rel="noopener noreferrer">http://localhost:8081/debugger-ui</a>.</p><p>Select <code>Tools → Developer Tools</code> from the Chrome Menu to open the <a href="https://developer.chrome.com/devtools" target="_blank" rel="noopener noreferrer">Developer Tools</a>. You may also access the DevTools using keyboard shortcuts (<code>⌘⌥I</code> on macOS, <code>Ctrl</code> <code>Shift</code> <code>I</code> on Windows). You may also want to enable <a href="http://stackoverflow.com/questions/2233339/javascript-is-there-a-way-to-get-chrome-to-break-on-all-errors/17324511#17324511" target="_blank" rel="noopener noreferrer">Pause On Caught Exceptions</a> for a better debugging experience.</p><blockquote><p>Note: the React Developer Tools Chrome extension does not work with React Native, but you can use its standalone version instead. Read <a href="/docs/debugging#react-developer-tools">this section</a> to learn how.</p></blockquote><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="debugging-using-a-custom-javascript-debugger"></a>Debugging using a custom JavaScript debugger<a aria-hidden="true" tabindex="-1" class="hash-link" href="#debugging-using-a-custom-javascript-debugger" title="Direct link to heading">#</a></h3><p>To use a custom JavaScript debugger in place of Chrome Developer Tools, set the <code>REACT_DEBUGGER</code> environment variable to a command that will start your custom debugger. You can then select "Debug JS Remotely" from the Developer Menu to start debugging.</p><p>The debugger will receive a list of all project roots, separated by a space. For example, if you set <code>REACT_DEBUGGER="node /path/to/launchDebugger.js --port 2345 --type ReactNative"</code>, then the command <code>node /path/to/launchDebugger.js --port 2345 --type ReactNative /path/to/reactNative/app</code> will be used to start your debugger.</p><blockquote><p>Custom debugger commands executed this way should be short-lived processes, and they shouldn't produce more than 200 kilobytes of output.</p></blockquote><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="safari-developer-tools"></a>Safari Developer Tools<a aria-hidden="true" tabindex="-1" class="hash-link" href="#safari-developer-tools" title="Direct link to heading">#</a></h2><p>You can use Safari to debug the iOS version of your app without having to enable "Debug JS Remotely".</p><ul><li>Enable Develop menu in Safari: <code>Preferences → Advanced → Select "Show Develop menu in menu bar"</code></li><li>Select your app's JSContext: <code>Develop → Simulator → JSContext</code></li><li>SafarLine truncated
|
||||
<script src="/styles.07d522c6.js"></script>
|
||||
<script src="/runtime~main.41b9ecdd.js"></script>
|
||||
<script src="/main.ac9e401f.js"></script>
|
||||
<script src="/runtime~main.56c3f166.js"></script>
|
||||
<script src="/main.5a3c9855.js"></script>
|
||||
<script src="/1.ba9ce8bd.js"></script>
|
||||
<script src="/2.58cb5d3d.js"></script>
|
||||
<script src="/1f391b9e.a824c215.js"></script>
|
||||
|
||||
Reference in new issue
Block a user