Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
70 lines (70 loc) · 27.1 KB
/
Copy pathindex.html
File metadata and controls
70 lines (70 loc) · 27.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.73">
<link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="ReScript React Native Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="ReScript React Native Blog Atom Feed">
<link rel="search" type="application/opensearchdescription+xml" title="ReScript React Native" href="/opensearch.xml"><title data-react-helmet="true">Usage | ReScript React Native</title><meta data-react-helmet="true" property="og:url" content="https://rescript-react-native.github.io/docs/usage"><meta data-react-helmet="true" name="docsearch:language" content="en"><meta data-react-helmet="true" name="docsearch:version" content="current"><meta data-react-helmet="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="Usage | ReScript React Native"><meta data-react-helmet="true" name="description" content="When rescript, @rescript/react and rescript-react-native are installed, you"><meta data-react-helmet="true" property="og:description" content="When rescript, @rescript/react and rescript-react-native are installed, you"><link data-react-helmet="true" rel="shortcut icon" href="/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://rescript-react-native.github.io/docs/usage"><link data-react-helmet="true" rel="alternate" href="https://rescript-react-native.github.io/docs/usage" hreflang="en"><link data-react-helmet="true" rel="alternate" href="https://rescript-react-native.github.io/docs/usage" hreflang="x-default"><link data-react-helmet="true" rel="preconnect" href="https://BH4D9OD16A-dsn.algolia.net" crossorigin="anonymous"><link rel="stylesheet" href="/assets/css/styles.2fec5e37.css">
<link rel="preload" href="/assets/js/styles.4e1a7d7c.js" as="script">
<link rel="preload" href="/assets/js/runtime~main.21935b97.js" as="script">
<link rel="preload" href="/assets/js/main.860c5b49.js" as="script">
<link rel="preload" href="/assets/js/1.94941d2b.js" as="script">
<link rel="preload" href="/assets/js/2.5958eae9.js" as="script">
<link rel="preload" href="/assets/js/3.cc5cb96f.js" as="script">
<link rel="preload" href="/assets/js/1be78505.d6d5be21.js" as="script">
<link rel="preload" href="/assets/js/117.fb7f1a62.js" as="script">
<link rel="preload" href="/assets/js/935f2afb.2fbaa992.js" as="script">
<link rel="preload" href="/assets/js/17896441.4595cf37.js" as="script">
<link rel="preload" href="/assets/js/6476eba6.537f4bb3.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div><a href="#main" class="skipToContent_1oUP">Skip to main content</a></div><nav class="navbar navbar--fixed-top navbar--dark"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle" type="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><img src="/ReScriptReactNative.svg" alt="ReScript React Native Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/ReScriptReactNative.svg" alt="ReScript React Native Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">ReScript React Native</strong></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/">Docs</a><a class="navbar__item navbar__link" href="/docs/components">Components</a><a class="navbar__item navbar__link" href="/docs/apis">APIs</a></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/blog">Blog</a><a href="https://github.com/rescript-react-native" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><div class="react-toggle displayOnlyInLargeViewport_GrZ2 react-toggle--disabled" role="button" tabindex="-1"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_71bT">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_71bT">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" class="react-toggle-screenreader-only" aria-label="Switch between dark and light mode"></div><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span></button></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/"><img src="/ReScriptReactNative.svg" alt="ReScript React Native Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/ReScriptReactNative.svg" alt="ReScript React Native Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">ReScript React Native</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link navbar__link--active" href="/docs/">Docs</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/components">Components</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/apis">APIs</a></li><li class="menu__list-item"><a class="menu__link" href="/blog">Blog</a></li><li class="menu__list-item"><a href="https://github.com/rescript-react-native" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li></ul></div></div></div></nav><div class="main-wrapper docs-wrapper doc-page"><div class="docPage_31aa"><div class="docSidebarContainer_3Kbt" role="complementary"><div class="sidebar_15mo"><div class="menu menu--responsive thin-scrollbar menu_Bmed"><button aria-label="Open menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_fgN0" width="24" height="24" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">Docs</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/">Getting Started</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/install">Installation</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/docs/usage">Usage</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/example">Example</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/cheatsheet">Cheatsheet</a></li></ul></li></ul></div></div></div><main class="docMainContainer_3ufF"><div class="container padding-vert--lg docItemWrapper_3FMP"><div class="row"><div class="col docItemCol_3FnS"><div class="docItemContainer_33ec"><article><header><h1 class="docTitle_3a4h">Usage</h1></header><div class="markdown"><p>When <code>rescript</code>, <code>@rescript/react</code> and <code>rescript-react-native</code> are installed, you
can run the following command</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly console"><div tabindex="0" class="prism-code language-console codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">npm run rescript</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>⚠️ <em>If this process looks fast to you, don't be surprised, that's because ReScript is fast!</em></p><p>This command should compile all <code>.res</code> files to their <code>.bs.js</code> counterparts.</p><p>This means if you have an <code>src/App.res</code> file, you should now have <code>src/App.bs.js</code>
file too.</p><p>You may also notice some compilation artifacts:</p><ul><li><code>.bsb.lock</code></li><li><code>.merlin</code></li><li><code>lib/bs</code></li></ul><p>You may want to gitignore all of these:</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly"><div tabindex="0" class="prism-code language-undefined codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">*.bs.js</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">.bsb.lock</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">.merlin</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">lib/bs</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p><em>If you used our template, it should be done already</em>.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="automate-compilation-of-res-files"></a>Automate compilation of <code>*.res</code> files<a class="hash-link" href="#automate-compilation-of-res-files" title="Direct link to heading">#</a></h2><p>You have multipes way to not have to think about compilation for your daily
workflow</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="compile-rescript-files-via-ide"></a>Compile ReScript files via IDE<a class="hash-link" href="#compile-rescript-files-via-ide" title="Direct link to heading">#</a></h2><p>To get the best development experience possible, we recommend you to use
<a href="https://code.visualstudio.com" target="_blank" rel="noopener noreferrer">VSCode</a> with
<a href="https://marketplace.visualstudio.com/items?itemName=chenglou92.rescript-vscode" target="_blank" rel="noopener noreferrer">ReScript plugin</a>
extension. Optionally you can add
<a href="https://marketplace.visualstudio.com/items?itemName=flowtype.flow-for-vscode" target="_blank" rel="noopener noreferrer">Flow Language Server</a>
extension if you have existing JavaScript covered by Flow.</p><p>⚠️ If you don’t want to use VSCode, we still recommend you to
<a href="https://rescript-lang.org/docs/manual/latest/editor-plugins" target="_blank" rel="noopener noreferrer">get a ReScript editor plugin</a>.</p><p>🎉 <strong>By having an IDE that handle ReScript compilation, you will not have to run a
command in the terminal</strong> to handle this & will just have to follow the standard
React Native workflow, your ReScript files being compiled to JavaScript.</p><p><em>You will also have inline errors & much more feature that won't be provided by
using a CLI workflow.</em></p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="vscode-workflow"></a>Vscode workflow<a class="hash-link" href="#vscode-workflow" title="Direct link to heading">#</a></h2><p>When you open VSCode with the ReScript plugin, you won't have to do anything.
The plugin will detect ReScript & will offer you to handle compilation by just clicking a button.</p><p><img alt="VSCode ReScript plugin" src="/assets/images/vscode-alert-1a4e9aea9b7f3d273857fe682a83e4bb.png"></p><p>⛑ <em>Even if you decide to use Vscode or a smiliar IDE to ease your day to day
development workflow, you should have a look to CLI workflow so you know how it
works.</em></p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="compile-rescript-files-via-cli"></a>Compile ReScript files via CLI<a class="hash-link" href="#compile-rescript-files-via-cli" title="Direct link to heading">#</a></h3><p>When you use React Native, you usually always have a terminal opened around with
Metro Bundler running, which bundle the JavaScript files.</p><p>Now you need to also have a process watching for your ReScript files to compile
then to JavaScript. The easiest way is to rely on ReScript <code>rescript</code> watch
option <code>-w</code>:</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly console"><div tabindex="0" class="prism-code language-console codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">npm run rescript build -w</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>If you are not familiar with ReScript <code>rescript</code> you should know that you might
sometimes have weird compilation errors due to outdated build artifacts. This
should not happen often but in case you are facing something weird, you can try
using <code>rescript</code> <code>clean</code> option</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly console"><div tabindex="0" class="prism-code language-console codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">npm run rescript clean</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>You might want to add this two commands in your <code>package.json</code> scripts:</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly json"><div tabindex="0" class="prism-code language-json codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"scripts"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"res:clean"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"rescript clean"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"res:build"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"rescript build"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"res:watch"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"rescript build -w"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"start"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"react-native start"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"ios"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"react-native run-ios"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"android"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"react-native run-android"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p><em>Note: you probably have <code>start</code> already.</em></p><p>If you are doing this change in your scripts, you can now use this development
workflow</p><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="cli-development-workflow"></a>CLI Development workflow<a class="hash-link" href="#cli-development-workflow" title="Direct link to heading">#</a></h4><p><strong>In one terminal:</strong></p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly console"><div tabindex="0" class="prism-code language-console codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">npm run res:watch</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>As soon as <code>.res</code> files are being compiled to <code>.bs.js</code>, you can either start the
project on <em>iOS Simulator</em> (included in <em>Xcode</em>) or an Android Emulator (if you
are unfamiliar with <em>Android Studio</em>, you might be interested by
<a href="https://www.genymotion.com" target="_blank" rel="noopener noreferrer">Genymotion</a>).</p><p><strong>In another terminal:</strong></p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly console"><div tabindex="0" class="prism-code language-console codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">npm run ios</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>or</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly console"><div tabindex="0" class="prism-code language-console codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">npm run android</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>This commands should open up a virtual device & start React Native
<a href="https://github.com/facebook/metro" target="_blank" rel="noopener noreferrer">metro bundler</a>. This packager will serves
the compiled ReScript code to the React Native client.</p><p>Now you can start coding by editing files in <code>src/</code>!</p><p><a href="https://reactnative.dev/docs/getting-started" target="_blank" rel="noopener noreferrer">Read more about starting the project in your environment of choice</a>.</p><p><strong>Note: as soon as you have the app installed in a simulator/emulator, you can
just run</strong></p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly console"><div tabindex="0" class="prism-code language-console codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">npm start</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>This avoid rebuilding the entire native parts & will just start React Native
metro bundler.</p><hr><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="interoperability-with-javascript"></a>Interoperability with JavaScript<a class="hash-link" href="#interoperability-with-javascript" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="using-javascript-components-from-reason"></a>Using JavaScript components from Reason<a class="hash-link" href="#using-javascript-components-from-reason" title="Direct link to heading">#</a></h3><p>Check out
<a href="https://rescript-lang.org/docs/manual/latest/import-from-export-to-js" target="_blank" rel="noopener noreferrer">ReScript <em>Import from/Export to JS</em> page</a>.</p><p>You can also browse the source of
<a href="https://github.com/rescript-react-native/rescript-react-native/tree/main/src" target="_blank" rel="noopener noreferrer">rescript-react-native</a>
because that's exactly what this project is doing!</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="using-rescript-react-native-components-from-javascript"></a>Using ReScript React Native components from JavaScript<a class="hash-link" href="#using-rescript-react-native-components-from-javascript" title="Direct link to heading">#</a></h3><p>Check out
<a href="https://rescript-lang.org/docs/manual/latest/import-from-export-to-js" target="_blank" rel="noopener noreferrer">ReScript <em>Import from/Export to JS</em> page</a></p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/rescript-react-native/rescript-react-native.github.io/edit/src/docs/usage.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2_ui" aria-label="Edit page"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Docs pages navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/docs/install"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Installation</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/docs/example"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Example »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_35-E thin-scrollbar"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#automate-compilation-of-res-files" class="table-of-contents__link">Automate compilation of <code>*.res</code> files</a></li><li><a href="#compile-rescript-files-via-ide" class="table-of-contents__link">Compile ReScript files via IDE</a></li><li><a href="#vscode-workflow" class="table-of-contents__link">Vscode workflow</a><ul><li><a href="#compile-rescript-files-via-cli" class="table-of-contents__link">Compile ReScript files via CLI</a></li></ul></li><li><a href="#interoperability-with-javascript" class="table-of-contents__link">Interoperability with JavaScript</a><ul><li><a href="#using-javascript-components-from-reason" class="table-of-contents__link">Using JavaScript components from Reason</a></li><li><a href="#using-rescript-react-native-components-from-javascript" class="table-of-contents__link">Using ReScript React Native components from JavaScript</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">Docs</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/docs/">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/components">Components</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/apis">APIs</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/rescript-react-native/rescript-react-native/discussions" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub Discussions</a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/rescript-react-native" target="_blank" rel="noopener noreferrer" class="footer__link-item">StackOverflow</a></li><li class="footer__item"><a href="https://forum.rescript-lang.org" target="_blank" rel="noopener noreferrer" class="footer__link-item">ReScript Forum</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">More</h4><ul class="footer__items"><li class="footer__item"><a href="https://rescript-lang.org" target="_blank" rel="noopener noreferrer" class="footer__link-item">ReScript Documentation</a></li><li class="footer__item"><a class="footer__link-item" href="/blog">Blog</a></li><li class="footer__item"><a href="https://github.com/rescript-react-native" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://github.com/rescript-react-native/rescript-react-native.github.io" target="_blank" rel="noopener noreferrer" class="footer__link-item">Wesbite Source</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">© 2022 ReScript React Native</div></div></div></footer></div>
<script src="/assets/js/styles.4e1a7d7c.js"></script>
<script src="/assets/js/runtime~main.21935b97.js"></script>
<script src="/assets/js/main.860c5b49.js"></script>
<script src="/assets/js/1.94941d2b.js"></script>
<script src="/assets/js/2.5958eae9.js"></script>
<script src="/assets/js/3.cc5cb96f.js"></script>
<script src="/assets/js/1be78505.d6d5be21.js"></script>
<script src="/assets/js/117.fb7f1a62.js"></script>
<script src="/assets/js/935f2afb.2fbaa992.js"></script>
<script src="/assets/js/17896441.4595cf37.js"></script>
<script src="/assets/js/6476eba6.537f4bb3.js"></script>
</body>
</html>