<?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: Evan Bacon</title>
    <description>The latest articles on DEV Community by Evan Bacon (@evanbacon).</description>
    <link>https://dev.to/evanbacon</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%2F192306%2Fa4e70807-8407-4743-a392-badcea32f863.png</url>
      <title>DEV Community: Evan Bacon</title>
      <link>https://dev.to/evanbacon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/evanbacon"/>
    <language>en</language>
    <item>
      <title>Fast Refresh with Expo Web! 🏃🏻‍♂️🔄</title>
      <dc:creator>Evan Bacon</dc:creator>
      <pubDate>Mon, 20 Apr 2020 16:29:30 +0000</pubDate>
      <link>https://dev.to/expo/fast-refresh-with-expo-web-3di2</link>
      <guid>https://dev.to/expo/fast-refresh-with-expo-web-3di2</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5vm63rmerqukriv7fxu1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5vm63rmerqukriv7fxu1.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you've used Expo on iOS or Android recently you've probably used Fast Refresh (by &lt;a href="https://github.com/gaearon" rel="noopener noreferrer"&gt;Dan Abramov&lt;/a&gt;) to achieve stateful hot reloading during development. But how do you use Fast Refresh with Expo for web.?.. (Pretty easily).&lt;/p&gt;

&lt;p&gt;On web this will update the DOM without reloading the page, this means the state will remain the same across updates. To fully update you can simply reload the window with ⌘ + R.&lt;/p&gt;

&lt;h1&gt;
  
  
  🤔 How to use
&lt;/h1&gt;

&lt;p&gt;Currently there's no official Fast Refresh Webpack plugin, but you can get started today using a great community plugin by &lt;a href="https://github.com/pmmmwh" rel="noopener noreferrer"&gt;Michael Mok&lt;/a&gt;!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bootstrap a new universal React Native project:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expo:&lt;/strong&gt; &lt;code&gt;expo init&lt;/code&gt; then select any project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other:&lt;/strong&gt; &lt;code&gt;npx create-react-native-app&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Install the community Fast Refresh package:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;yarn add -D @pmmmwh/react-refresh-webpack-plugin webpack-hot-middleware&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Eject the Webpack config:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;expo customize:web&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;In your newly created &lt;code&gt;webpack.config.js&lt;/code&gt;:&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createExpoWebpackConfigAsync&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@expo/webpack-config&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ReactRefreshWebpackPlugin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@pmmmwh/react-refresh-webpack-plugin&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createExpoWebpackConfigAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Use the React refresh plugin in development mode&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mode&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;development&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ReactRefreshWebpackPlugin&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;disableRefreshCheck&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Now in your &lt;code&gt;babel.config.js&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// This caches the Babel config by environment.&lt;/span&gt;
  &lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;using&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;presets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;babel-preset-expo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Now run &lt;code&gt;expo start:web&lt;/code&gt; to use it!&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  💡 BTW
&lt;/h1&gt;

&lt;p&gt;When the official React fast refresh has been released, we will work on unifying it with native to create a universal solution. Until then this is a pretty nifty little feature! :]&lt;/p&gt;

&lt;h2&gt;
  
  
  Why share now then?
&lt;/h2&gt;

&lt;p&gt;I got the idea for this tutorial from my friend Tim Neutkens of Next.js. I highly recommend &lt;a href="https://dev.to/evanbacon/next-js-expo-and-react-native-for-web-3kd9"&gt;using Next.js with Expo for web&lt;/a&gt; especially for navigation!&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1251942933953228802-640" src="https://platform.twitter.com/embed/Tweet.html?id=1251942933953228802"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1251942933953228802-640');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1251942933953228802&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;h1&gt;
  
  
  👋 That's all
&lt;/h1&gt;

&lt;p&gt;Thanks for reading, that's all I've got for you today. Let me know if you enjoyed this article, and reach out if you have any more questions!&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
 &lt;td&gt;
&lt;a href="https://twitter.com/baconbrix" rel="noopener noreferrer"&gt;
    &lt;img alt="Twitter: baconbrix" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Ftwitter%2Ffollow%2Fbaconbrix.svg%3Fstyle%3Dflat-square%26logo%3DTWITTER%26logoColor%3DFFFFFF%26labelColor%3D00aced%26logoWidth%3D20%26color%3Dlightgray"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://github.com/evanbacon" rel="noopener noreferrer"&gt;
    &lt;img alt="Github: evanbacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fgithub%2Ffollowers%2Fevanbacon.svg%3Flabel%3DFollow%26style%3Dflat-square%26logo%3Dgithub%26logoColor%3DFFFFFF%26labelColor%3D24292e%26logoWidth%3D20%26color%3Dlightgray"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.instagram.com/baconbrix" rel="noopener noreferrer"&gt;
    &lt;img alt="Instagram: baconbrix" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2F%40baconbrix-E4405F.svg%3Fstyle%3Dflat-square%26logo%3DINSTAGRAM%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.linkedin.com/in/evanbacon" rel="noopener noreferrer"&gt;
    &lt;img alt="LinkedIn: evanbacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2Fconnect-0077b5.svg%3Fstyle%3Dflat-square%26logo%3DLINKEDIN%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.youtube.com/c/exposition?sub_confirmation=1" rel="noopener noreferrer"&gt;
    &lt;img alt="YouTube: Evan Bacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FWatch-FF0000.svg%3Fstyle%3Dflat-square%26logo%3DYOUTUBE%26labelColor%3DFF0000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="http://evanbacon.dev" rel="noopener noreferrer"&gt;
    &lt;img alt="Website: Evan Bacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FPortfolio-4630EB.svg%3Fstyle%3Dflat-square%26logo%3DEXPO%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>🤔🌐 React Native for web developers</title>
      <dc:creator>Evan Bacon</dc:creator>
      <pubDate>Wed, 19 Feb 2020 19:21:22 +0000</pubDate>
      <link>https://dev.to/evanbacon/react-native-for-web-developers-1pi0</link>
      <guid>https://dev.to/evanbacon/react-native-for-web-developers-1pi0</guid>
      <description>&lt;p&gt;In the world of web development, &lt;strong&gt;everything&lt;/strong&gt; is streamlined. The concept of React Native is really appealing to a React developer on paper, but abandoning your existing knowledge of HTML and CSS in favor of primitives like View, Image, Text can be a lot to handle. But what if it didn't need to be? What if you could &lt;em&gt;truly&lt;/em&gt; build native apps with your already existing knowledge of building websites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;a href="https://github.com/expo/expo/blob/master/packages/html-elements" rel="noopener noreferrer"&gt;You can now&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The Issue
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;This article assumes you know React Native can be used to create iOS, Android, and Web apps. If you don't &lt;a href="https://www.youtube.com/watch?v=ykBxY01j_rA" rel="noopener noreferrer"&gt;watch this&lt;/a&gt;!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl1wvn3lgbpyby0n9tr8f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl1wvn3lgbpyby0n9tr8f.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React Native is great ... for native developers (and by extension the entire human race 😁). Instead of using Objective-C, or Java you can build your native app cross-platform with just &lt;del&gt;JavaScript&lt;/del&gt; TypeScript! Even with the entirely original ideas of Flutter and SwiftUI from Google and Apple respectively, React Native is a no-brainer. The flexibility of JavaScript, the convenience of OTA updates, &lt;strong&gt;&lt;a href="https://expo.io/" rel="noopener noreferrer"&gt;Expo as a whole&lt;/a&gt;&lt;/strong&gt;. React Native has it all.&lt;/p&gt;

&lt;p&gt;...unless you're a web developer. Then it's missing a few things. &lt;/p&gt;

&lt;h1&gt;
  
  
  The learning curve of React Native
&lt;/h1&gt;

&lt;p&gt;The default flavor of React Native considers all platforms equally, this means the API you interface with doesn't have any platform specific references. A good example of this is linking. &lt;/p&gt;

&lt;p&gt;Say we want to create a text link to open another website.&lt;/p&gt;

&lt;p&gt;In the browser you simply create a link:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://dev.to"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Natively you would create a generic &lt;code&gt;Text&lt;/code&gt; element and use the &lt;code&gt;Linking&lt;/code&gt; API to open a URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Linking&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;openLink&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;Linking&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;openURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://dev.to&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt; &lt;span class="na"&gt;onPress&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;openLink&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Link&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now universally with Expo (iOS, Android, and Web), you'd do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Platform&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Linking&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;
    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;accessibilityRole&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"link"&lt;/span&gt;
    &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;onPress&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Platform&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;OS&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;web&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
        &lt;span class="nx"&gt;Linking&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;openURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Link&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://dev.to"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Link&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Link&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is pretty unintuitive if you're coming from a web development background. For the sake of brevity I won't get into how much of nightmare it is to use this with TypeScript. &lt;code&gt;href&lt;/code&gt; isn't in the TypeScript definition for &lt;code&gt;&amp;lt;Text /&amp;gt;&lt;/code&gt; because web support is an out-of-tree solution. If you want to add TypeScript support you'd have to remap the types of the Text element which takes a lot of digging to get right.&lt;/p&gt;

&lt;h1&gt;
  
  
  Problem 002
&lt;/h1&gt;

&lt;p&gt;Every front end developer talks about how native apps have features that you just can't get in the browser. But what about the web-only features that you can't get natively? Possibly the most important feature like this is SEO. For many websites &lt;em&gt;indexing&lt;/em&gt; is critical to success. &lt;br&gt;
SEO is a very unexplored, and difficult thing to do with React Native (minus this article I wrote about &lt;a href="https://dev.to/evanbacon/next-js-expo-and-react-native-for-web-3kd9"&gt;using Expo with Next.js&lt;/a&gt;).&lt;/p&gt;
&lt;h1&gt;
  
  
  The Solution
&lt;/h1&gt;

&lt;p&gt;Considering the issues I just laid out, the solution is somewhat obvious. React developers don't need "React Native", they need "React DOM rendered natively". &lt;br&gt;
So I created a library which helps you do just that, called &lt;a href="http://npmjs.com/package/@expo/html-elements" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;@expo/html-elements&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;. &lt;br&gt;
A set of (currently &lt;strong&gt;40&lt;/strong&gt; new) light-weight, universal components named after HTML elements that help ease you into the React Native world without actually adding any overhead to your native project. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;@expo/html-elements&lt;/code&gt; also help you accomplish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An easier path for all users of React Native to implement common web functionality in their universal apps.&lt;/li&gt;
&lt;li&gt;Optimized for SEO by using the correct DOM element whenever possible.&lt;/li&gt;
&lt;li&gt;More automation around A11Y in your iOS, Android, and web projects.&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu9cv0f3nji1az58hebzs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu9cv0f3nji1az58hebzs.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you want to build a simple link you can!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;A&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@expo/html-elements&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;A&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_blank&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This link then converts to the following A11Y compliant link element while stripping away unused props:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Web&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;a dir="auto" href="#" role="link" target="_blank" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Native&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Text accessibilityRole="link" onPress={() =&amp;gt; Linking.openURL('#')} /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Having an &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element is good for a few reasons. You get the "copy link address" feature, the hover preview, peek and pop on iOS, and a few other things users have come to expect from the web.&lt;/p&gt;

&lt;h1&gt;
  
  
  Smarter Layouts
&lt;/h1&gt;

&lt;p&gt;Using headers and other layout elements won't impact your native app, but not using them can impact your web search results. Consider the following page in my app:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://snack.expo.io/@bacon/basic-seo-001" rel="noopener noreferrer"&gt;&lt;strong&gt;Try it&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;My Story&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;I did a thing with Lego now I code&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"follow me"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Web crawlers and screen readers see a bunch of raw data like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;My Story&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;I did a thing with Lego now I code&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you were making a basic website with HTML (and not creating an app) you would probably use a variety of elements to ensure screen readers and crawlers work optimally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;My Story&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;I did a thing with Lego now I code&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells the crawlers so much about our page, but how do we get this without compromising our native app? Well, to be honest it was actually pretty difficult and required a deep understanding of React Native web to figure out... But now with &lt;code&gt;@expo/html-elements&lt;/code&gt; (!!) you simply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;H1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;P&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Footer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@expo/html-elements&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;H1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;My Story&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;H1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;P&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;I did a thing with Lego now I code&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;P&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Footer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"follow me"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Footer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now my page has universal A11Y features, and uses more of the correct DOM elements in the browser! 😎 &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Web&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;h1&amp;gt;My Story&amp;lt;/h1&amp;gt;&amp;lt;main role="main"&amp;gt;&amp;lt;div&amp;gt;I did a thing with Lego now I code&amp;lt;/div&amp;gt;&amp;lt;/main&amp;gt;&amp;lt;footer&amp;gt;&amp;lt;div role="button" /&amp;gt;&amp;lt;/footer&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Native&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Text&amp;gt;My Story&amp;lt;/Text&amp;gt;&amp;lt;View&amp;gt;&amp;lt;Text&amp;gt;I did a thing with Lego now I code&amp;lt;/Text&amp;gt;&amp;lt;/View&amp;gt;&amp;lt;View&amp;gt;&amp;lt;Button title="follow me" /&amp;gt;&amp;lt;/View&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Due to the way text style inheritance works we still use a &lt;code&gt;div&lt;/code&gt; for things like p, b, strong, etc. unless that text is a child, then it uses a &lt;code&gt;span&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;p&gt;You can get started right away using snack: &lt;a href="https://snack.expo.io/@bacon/blank-elements" rel="noopener noreferrer"&gt;https://snack.expo.io/@bacon/blank-elements&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Or -&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a universal project and get started using it locally:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install the CLI &lt;code&gt;npm i -g expo-cli&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a new project &lt;code&gt;expo init my-project&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Install the package &lt;code&gt;yarn add @expo/html-elements&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start the project with &lt;code&gt;expo start&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Press &lt;code&gt;w&lt;/code&gt; to open in the browser&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;i&lt;/code&gt; to open iOS in the simulator&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;a&lt;/code&gt; to start the project on an Android emulator&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Optionally:&lt;/strong&gt; You can also use this package with any React Native tool&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ignite CLI: &lt;a href="https://github.com/infinitered/ignite" rel="noopener noreferrer"&gt;&lt;code&gt;ignite-cli&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Community CLI: &lt;code&gt;@react-native-community/cli&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Perhaps you haven't encountered any of the issues &lt;code&gt;@expo/html-elements&lt;/code&gt; solves, or you think they could be solved in a different way, I'd love to hear your feedback.&lt;/p&gt;

&lt;p&gt;I imagine some people may see this package and think that their native app is simply running in a web view like Cordova. This is absolutely &lt;strong&gt;NOT&lt;/strong&gt; the case. Your views are still all optimally rendered as native views. If you encounter any misconceptions regarding this, I would appreciate you directing those folks to this post!&lt;/p&gt;

&lt;h1&gt;
  
  
  👋 Thanks for Reading
&lt;/h1&gt;

&lt;p&gt;I hope this makes your transition from web development to web + native development even easier! If you enjoyed, staring the repo would be much appreciated: &lt;a href="https://github.com/expo/expo/blob/master/packages/html-elements/" rel="noopener noreferrer"&gt;&lt;code&gt;@expo/html-elements&lt;/code&gt;&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep in Touch!!
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
 &lt;td&gt;
&lt;a href="https://twitter.com/baconbrix" rel="noopener noreferrer"&gt;
    &lt;img alt="Twitter: baconbrix" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Ftwitter%2Ffollow%2Fbaconbrix.svg%3Fstyle%3Dflat-square%26logo%3DTWITTER%26logoColor%3DFFFFFF%26labelColor%3D00aced%26logoWidth%3D20%26color%3Dlightgray"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://github.com/evanbacon" rel="noopener noreferrer"&gt;
    &lt;img alt="Github: evanbacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fgithub%2Ffollowers%2Fevanbacon.svg%3Flabel%3DFollow%26style%3Dflat-square%26logo%3Dgithub%26logoColor%3DFFFFFF%26labelColor%3D24292e%26logoWidth%3D20%26color%3Dlightgray"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.instagram.com/baconbrix" rel="noopener noreferrer"&gt;
    &lt;img alt="Instagram: baconbrix" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2F%40baconbrix-E4405F.svg%3Fstyle%3Dflat-square%26logo%3DINSTAGRAM%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.linkedin.com/in/evanbacon" rel="noopener noreferrer"&gt;
    &lt;img alt="LinkedIn: evanbacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2Fconnect-0077b5.svg%3Fstyle%3Dflat-square%26logo%3DLINKEDIN%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.youtube.com/c/exposition?sub_confirmation=1" rel="noopener noreferrer"&gt;
    &lt;img alt="YouTube: Evan Bacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FWatch-FF0000.svg%3Fstyle%3Dflat-square%26logo%3DYOUTUBE%26labelColor%3DFF0000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="http://evanbacon.dev" rel="noopener noreferrer"&gt;
    &lt;img alt="Website: Evan Bacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FPortfolio-4630EB.svg%3Fstyle%3Dflat-square%26logo%3DEXPO%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Getting Started with Expo Web</title>
      <dc:creator>Evan Bacon</dc:creator>
      <pubDate>Wed, 29 Jan 2020 08:38:13 +0000</pubDate>
      <link>https://dev.to/evanbacon/getting-started-with-expo-web-168g</link>
      <guid>https://dev.to/evanbacon/getting-started-with-expo-web-168g</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;👉 This guide is for beginner React devs with no knowledge of Expo, or building mobile apps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Expo lets you build and deploy &lt;em&gt;real&lt;/em&gt; iOS, Android, and Web apps with React and JavaScript. Expo websites are performant and highly customizable; meaning you can use them with any of your existing React tools like &lt;a href="https://docs.expo.io/versions/latest/guides/using-nextjs/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt;, &lt;a href="https://docs.expo.io/versions/latest/guides/using-gatsby/" rel="noopener noreferrer"&gt;Gatsby&lt;/a&gt;, &lt;a href="https://dev.to/evanbacon/smaller-faster-websites-with-preact-and-expo-2m2b"&gt;Preact&lt;/a&gt;, &lt;a href="https://docs.expo.io/versions/latest/guides/using-electron/" rel="noopener noreferrer"&gt;Electron&lt;/a&gt;, etc... &lt;/p&gt;

&lt;p&gt;This guide will quickly show you the basics for creating a &lt;strong&gt;website&lt;/strong&gt; and deploying it to the web in minutes! For more on mobile apps check out the &lt;a href="https://docs.expo.io/versions/latest/get-started/create-a-new-app/" rel="noopener noreferrer"&gt;Expo docs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;You'll Learn how to:&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;🔽 Install&lt;/th&gt;
&lt;th&gt;💫 Initialize&lt;/th&gt;
&lt;th&gt;🏃🏼‍♀️ Start&lt;/th&gt;
&lt;th&gt;🚀 Build&lt;/th&gt;
&lt;th&gt;🔼 Deploy&lt;/th&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;🔽 Components&lt;/td&gt;
&lt;td&gt;💫 Run Everywhere&lt;/td&gt;
&lt;td&gt;🏃🏼‍♀️ Learn More&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install the Expo CLI and make a new universal project (Web, iOS, Android):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Absolute beginners with no coding experience should visit &lt;a href="https://snack.expo.io/" rel="noopener noreferrer"&gt;snack.expo.io&lt;/a&gt; to get started in the browser without using the terminal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; expo-cli


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a &lt;strong&gt;new Expo project&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 &lt;a href="https://docs.expo.io/versions/latest/get-started/create-a-new-app/" rel="noopener noreferrer"&gt;Learn more about &lt;code&gt;expo init&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;expo init myProject 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now enter the project and &lt;strong&gt;start&lt;/strong&gt; it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;myProject

&lt;span class="nv"&gt;$ &lt;/span&gt;expo start &lt;span class="nt"&gt;--web&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Your browser will automatically open to the website and you'll see this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foujur0hayv59krzaay1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foujur0hayv59krzaay1p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a&gt;Building&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Creating a &lt;strong&gt;production&lt;/strong&gt; build is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Expo Web builds live in the &lt;code&gt;web-build&lt;/code&gt; folder.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;expo build:web


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can &lt;strong&gt;deploy&lt;/strong&gt; the website using &lt;a href="https://docs.expo.io/versions/latest/guides/deploying-websites" rel="noopener noreferrer"&gt;&lt;em&gt;any&lt;/em&gt; hosting service&lt;/a&gt;. For this example we'll use &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;npx netlify deploy &lt;span class="nt"&gt;--dir&lt;/span&gt; web-build


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And that's all! You just created and deployed your first universal Expo website!! See some &lt;strong&gt;&lt;a href="https://github.com/expo/examples" rel="noopener noreferrer"&gt;examples&lt;/a&gt;&lt;/strong&gt; and learn more in the &lt;strong&gt;&lt;a href="https://docs.expo.io/versions/latest/tutorial/text" rel="noopener noreferrer"&gt;Expo Documentation&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  🤔 How Expo Web Works
&lt;/h1&gt;

&lt;p&gt;Every screen in an Expo app is a &lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;React Component&lt;/a&gt;, but instead of using &lt;code&gt;&amp;lt;div/&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;p/&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;img/&amp;gt;&lt;/code&gt; - Expo uses &lt;code&gt;&amp;lt;View /&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;Text /&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;Image /&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;ScrollView /&amp;gt;&lt;/code&gt;, etc...&lt;/p&gt;

&lt;p&gt;The first component in your app is whatever JSX you export from &lt;code&gt;App.js&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Text&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Expo Everywhere!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  🏃🏻‍♂️ Running Everywhere
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;🌐 Try Expo Web in the &lt;strong&gt;browser&lt;/strong&gt; with:
```sh
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;$ expo start --web&lt;/p&gt;

&lt;h1&gt;
  
  
  or faster in web-only mode
&lt;/h1&gt;

&lt;p&gt;$ expo start:web&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- 💻 Run in the **simulator** with:
```sh


$ expo start --ios

# or Android

$ expo start --android


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;📱 You can also open this on your &lt;strong&gt;phone&lt;/strong&gt; with the &lt;a href="https://expo.io/tools" rel="noopener noreferrer"&gt;Expo client&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  🕵️‍♀️ Learn More
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;🎨 Now you can &lt;strong&gt;&lt;a href="https://docs.expo.io/versions/latest/tutorial/text" rel="noopener noreferrer"&gt;style the text&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🚗 Start Navigating and Routing with Expo's &lt;a href="https://reactnavigation.org/docs/en/hello-react-navigation.html" rel="noopener noreferrer"&gt;React Navigation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;🚀 Use with &lt;a href="https://docs.expo.io/versions/latest/guides/using-nextjs/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt; or &lt;a href="https://docs.expo.io/versions/latest/guides/using-gatsby/" rel="noopener noreferrer"&gt;Gatsby&lt;/a&gt; for simple web-only navigation and routing.&lt;/li&gt;
&lt;li&gt;🔥 Use a &lt;strong&gt;Universal Expo Component Library&lt;/strong&gt; to get moving faster:

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://react-native-elements.github.io/react-native-elements/" rel="noopener noreferrer"&gt;Elements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/callstack/react-native-paper" rel="noopener noreferrer"&gt;Material Design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://akveo.github.io/react-native-ui-kitten/" rel="noopener noreferrer"&gt;Kittens&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;⭐️ You can also simply visit &lt;a href="https://snack.expo.io/" rel="noopener noreferrer"&gt;snack.expo.io&lt;/a&gt; to get started in the browser without installing anything!&lt;/li&gt;

&lt;/ul&gt;

&lt;h1&gt;
  
  
  👋 Thanks for Reading
&lt;/h1&gt;

&lt;p&gt;That's all for now. Keep up with the latest Expo Web news by following 👇&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
 &lt;td&gt;
&lt;a href="https://twitter.com/baconbrix" rel="noopener noreferrer"&gt;
    &lt;img alt="Twitter: baconbrix" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Ftwitter%2Ffollow%2Fbaconbrix.svg%3Fstyle%3Dflat-square%26logo%3DTWITTER%26logoColor%3DFFFFFF%26labelColor%3D00aced%26logoWidth%3D20%26color%3Dlightgray"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://github.com/evanbacon" rel="noopener noreferrer"&gt;
    &lt;img alt="Github: evanbacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fgithub%2Ffollowers%2Fevanbacon.svg%3Flabel%3DFollow%26style%3Dflat-square%26logo%3Dgithub%26logoColor%3DFFFFFF%26labelColor%3D24292e%26logoWidth%3D20%26color%3Dlightgray"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.instagram.com/baconbrix" rel="noopener noreferrer"&gt;
    &lt;img alt="Instagram: baconbrix" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2F%40baconbrix-E4405F.svg%3Fstyle%3Dflat-square%26logo%3DINSTAGRAM%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.linkedin.com/in/evanbacon" rel="noopener noreferrer"&gt;
    &lt;img alt="LinkedIn: evanbacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2Fconnect-0077b5.svg%3Fstyle%3Dflat-square%26logo%3DLINKEDIN%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.youtube.com/c/exposition?sub_confirmation=1" rel="noopener noreferrer"&gt;
    &lt;img alt="YouTube: Evan Bacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FWatch-FF0000.svg%3Fstyle%3Dflat-square%26logo%3DYOUTUBE%26labelColor%3DFF0000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="http://evanbacon.dev" rel="noopener noreferrer"&gt;
    &lt;img alt="Website: Evan Bacon" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FPortfolio-4630EB.svg%3Fstyle%3Dflat-square%26logo%3DEXPO%26labelColor%3D000%26logoWidth%3D20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>👑⚙️ Smaller, Faster Websites with Preact and Expo</title>
      <dc:creator>Evan Bacon</dc:creator>
      <pubDate>Wed, 22 Jan 2020 18:13:53 +0000</pubDate>
      <link>https://dev.to/evanbacon/smaller-faster-websites-with-preact-and-expo-2m2b</link>
      <guid>https://dev.to/evanbacon/smaller-faster-websites-with-preact-and-expo-2m2b</guid>
      <description>&lt;p&gt;React Native for web is &lt;strong&gt;awesome&lt;/strong&gt; because not only can you reuse all of the dope native Expo packages like &lt;a href="https://www.npmjs.com/package/expo-camera"&gt;expo-camera&lt;/a&gt; and &lt;a href="https://github.com/software-mansion/react-native-gesture-handler"&gt;react-native-gesture-handler&lt;/a&gt;, but you can also use any of the neat things coming out of the React/web community to create blazingly fast websites.&lt;/p&gt;

&lt;p&gt;A great example of this is the library Preact by &lt;a href="https://twitter.com/_developit"&gt;Jason Miller&lt;/a&gt;! &lt;a href="https://preactjs.com/"&gt;Preact&lt;/a&gt; is a light-weight (~3kb) alternative to React. &lt;br&gt;
When building a web-only project setup is simple, you can just replace React with Preact and start coding right away, but React Native for web is a little bit more complicated. &lt;br&gt;
Because RNWeb uses many different React features we have to really push Preact to its limits to get it working with Expo for web. Luckily it's still pretty simple to setup.&lt;/p&gt;

&lt;h1&gt;
  
  
  Before Preact
&lt;/h1&gt;

&lt;p&gt;Before we cover the how, let's talk about why you might want to use Preact. If you create a standard Expo web project (at the time of writing this article), the bundle size will look something like the report below. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❌ 60.75 KB Gzipped&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--opt_6hIV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/2wnj5q9p9cfdvz5wt0wj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--opt_6hIV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/2wnj5q9p9cfdvz5wt0wj.png" alt="expo web bundle without preact" title="Expo web bundle without Preact" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  After Preact
&lt;/h1&gt;

&lt;p&gt;If you configure your project to use Preact instead of React, the bundle will reduce drastically! This means your website will load faster and work much better for users with poor internet connections or low-end devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 27.98 KB Gzipped&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8reSuU-g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/xn5j13vhxfaohz462uer.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8reSuU-g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/xn5j13vhxfaohz462uer.png" alt="expo web bundle with preact" title="Expo web bundle with Preact" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  ⚽️ Getting Started
&lt;/h1&gt;

&lt;p&gt;To use Preact with React Native for web, you'll need to install the packages and alias them to React.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 The most updated info is in the Expo docs: &lt;a href="https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-preact.md"&gt;Using Preact&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Install Preact (requires Preact 10+): 

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;yarn add preact-responder-event-plugin preact&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;or &lt;code&gt;npm install --save preact-responder-event-plugin preact&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Create a custom Webpack config for the Expo CLI to use:

&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;expo customize:web&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;webpack.config.js&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Modify the Webpack config to use Preact instead of React:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createExpoWebpackConfigAsync&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@expo/webpack-config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;BundleAnalyzerPlugin&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;webpack-bundle-analyzer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;createExpoWebpackConfigAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Add more aliases&lt;/span&gt;
    &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;alias&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="c1"&gt;// Use Preact aliases&lt;/span&gt;
      &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="na"&gt;$&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;preact/compat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom$&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;preact/compat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="c1"&gt;// Fix the responder system which react-native-web depends on&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom/unstable-native-dependencies$&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;preact-responder-event-plugin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="c1"&gt;// Optionally you can enable the bundle size report. &lt;/span&gt;
    &lt;span class="c1"&gt;// It's best to do this only with production builds.&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mode&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;BundleAnalyzerPlugin&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;web-report&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Running &lt;code&gt;expo build:web&lt;/code&gt; will now use Preact instead of React. This means you'll now have a significantly smaller bundle! 🚀&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Drawbacks
&lt;/h1&gt;

&lt;p&gt;To achieve a smaller bundle size Preact has to cut a few features. For instance they don't support synthetic events. Another major drawback is that usage with React Native isn't very clear, if you're building a universal app you may want to consider using the same version of React across web and mobile. For more information on issues using Preact with React Native for web, please refer to this issue &lt;a href="https://github.com/necolas/react-native-web/issues/1219"&gt;react-native-web#1219&lt;/a&gt; (link courtesy of Max Thirouin)&lt;/p&gt;

&lt;h1&gt;
  
  
  👋 That's all
&lt;/h1&gt;

&lt;p&gt;Thanks for reading, that's all I've got for you today. Let me know if you enjoyed this article, and reach out if you have any more questions!&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
 &lt;td&gt;
&lt;a href="https://twitter.com/baconbrix"&gt;
    &lt;img alt="Twitter: baconbrix" src="https://res.cloudinary.com/practicaldev/image/fetch/s--h_i5rhBL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/twitter/follow/baconbrix.svg%3Fstyle%3Dflat-square%26logo%3DTWITTER%26logoColor%3DFFFFFF%26labelColor%3D00aced%26logoWidth%3D20%26color%3Dlightgray" width="157" height="20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://github.com/evanbacon"&gt;
    &lt;img alt="Github: evanbacon" src="https://res.cloudinary.com/practicaldev/image/fetch/s--EWIF0GS1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/github/followers/evanbacon.svg%3Flabel%3DFollow%26style%3Dflat-square%26logo%3Dgithub%26logoColor%3DFFFFFF%26labelColor%3D24292e%26logoWidth%3D20%26color%3Dlightgray" width="103" height="20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.instagram.com/baconbrix"&gt;
    &lt;img alt="Instagram: baconbrix" src="https://res.cloudinary.com/practicaldev/image/fetch/s--K-9eBtCB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/badge/%40baconbrix-E4405F.svg%3Fstyle%3Dflat-square%26logo%3DINSTAGRAM%26labelColor%3D000%26logoWidth%3D20" width="106" height="20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.linkedin.com/in/evanbacon"&gt;
    &lt;img alt="LinkedIn: evanbacon" src="https://res.cloudinary.com/practicaldev/image/fetch/s--tHghCoFt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/badge/connect-0077b5.svg%3Fstyle%3Dflat-square%26logo%3DLINKEDIN%26labelColor%3D000%26logoWidth%3D20" width="84" height="20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://www.youtube.com/c/exposition?sub_confirmation=1"&gt;
    &lt;img alt="YouTube: Evan Bacon" src="https://res.cloudinary.com/practicaldev/image/fetch/s--xRjgZnfk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/badge/Watch-FF0000.svg%3Fstyle%3Dflat-square%26logo%3DYOUTUBE%26labelColor%3DFF0000%26logoWidth%3D20" width="76" height="20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="http://evanbacon.dev"&gt;
    &lt;img alt="Website: Evan Bacon" src="https://res.cloudinary.com/practicaldev/image/fetch/s--CL7-AJWa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/badge/Portfolio-4630EB.svg%3Fstyle%3Dflat-square%26logo%3DEXPO%26labelColor%3D000%26logoWidth%3D20" width="86" height="20"&gt;
  &lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>tutorial</category>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Adding Dark Mode Support to Next.js, and Expo Projects</title>
      <dc:creator>Evan Bacon</dc:creator>
      <pubDate>Fri, 03 Jan 2020 21:33:30 +0000</pubDate>
      <link>https://dev.to/evanbacon/adding-dark-mode-support-to-next-js-and-expo-projects-517a</link>
      <guid>https://dev.to/evanbacon/adding-dark-mode-support-to-next-js-and-expo-projects-517a</guid>
      <description>&lt;p&gt;👋 Quick tutorial today! Here I'll show you how to setup your universal web &amp;amp; mobile app to use the client device's native color scheme! You can also use this same approach to setup other awesome features like &lt;a href="https://github.com/th3rdwave/react-native-safe-area-context"&gt;React Native Safe Area Context&lt;/a&gt; and &lt;a href="https://github.com/expo/react-native-action-sheet"&gt;Expo Action Sheets&lt;/a&gt;! 💙&lt;/p&gt;

&lt;h2&gt;
  
  
  Tutorial
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;First setup your &lt;a href="https://docs.expo.io/versions/latest/guides/using-nextjs"&gt;Expo or Next.js app to be universal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install the universal Expo package &lt;a href="https://github.com/expo/react-native-appearance#readme"&gt;react-native-appearance&lt;/a&gt;: &lt;code&gt;yarn add react-native-appearance&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;[Web] Add the Appearance &lt;a href="https://reactjs.org/docs/context.html"&gt;React Context provider&lt;/a&gt; to the root of your Next.js app by creating &lt;code&gt;pages/_app.js&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AppearanceProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-appearance&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pageProps&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;  
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AppearanceProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Component&lt;/span&gt; &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;pageProps&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;AppearanceProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;[Mobile] Add the Appearance provider to the root of your Expo app in your &lt;code&gt;./App.js&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AppearanceProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-appearance&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;  
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AppearanceProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* ... */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;AppearanceProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now you can use the &lt;code&gt;useColorScheme&lt;/code&gt; hook anywhere in your Expo + Next.js app!
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useColorScheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-appearance&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;colorScheme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useColorScheme&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isDark&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;colorScheme&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;isDark&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;white&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;black&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hey 👋&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;That's it!&lt;/strong&gt; I use the same approach in my personal portfolio (Demo Image):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zgrCkHAL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/eqii5iieri9bkqit8k04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zgrCkHAL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/eqii5iieri9bkqit8k04.png" alt="Alt Text" width="800" height="423"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rrVSLziQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/j46ys1to3o4dr1615gam.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rrVSLziQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/j46ys1to3o4dr1615gam.png" alt="Alt Text" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  React Navigation
&lt;/h3&gt;

&lt;p&gt;If your Expo app is using React Navigation (v4) then you'll want to wrap the navigation like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AppearanceProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-appearance&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createAppContainer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-navigation&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createStackNavigator&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-navigation-stack&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Can be any navigator&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;AppNavigator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createStackNavigator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* Your routes */&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;ContextNavigator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AppearanceProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AppNavigator&lt;/span&gt; &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;AppearanceProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// Hoist the routes&lt;/span&gt;
&lt;span class="nx"&gt;ContextNavigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;AppNavigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Export the full navigator&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;createAppContainer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ContextNavigator&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Thanks for reading!
&lt;/h2&gt;

&lt;p&gt;Please let me know if you found any problems! Also if you found this helpful, be sure to share it (possibly by printing the article out and handing it out around town 😄) and of course, &lt;strong&gt;smash&lt;/strong&gt; that random unicorn button! 🦄&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>react</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Using Expo SDK with Next.js websites</title>
      <dc:creator>Evan Bacon</dc:creator>
      <pubDate>Tue, 03 Dec 2019 18:15:42 +0000</pubDate>
      <link>https://dev.to/evanbacon/next-js-expo-and-react-native-for-web-3kd9</link>
      <guid>https://dev.to/evanbacon/next-js-expo-and-react-native-for-web-3kd9</guid>
      <description>&lt;p&gt;This tutorial has moved to &lt;a href="https://github.com/expo/expo-cli/tree/main/packages/next-adapter"&gt;expo/next-adapter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>🚀 Gatsby + React Native for Web + Expo 🥳</title>
      <dc:creator>Evan Bacon</dc:creator>
      <pubDate>Wed, 27 Nov 2019 21:37:18 +0000</pubDate>
      <link>https://dev.to/evanbacon/gatsby-react-native-for-web-expo-2kgc</link>
      <guid>https://dev.to/evanbacon/gatsby-react-native-for-web-expo-2kgc</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; 🎳 &lt;a href="https://github.com/expo/examples/tree/master/with-gatsby" rel="noopener noreferrer"&gt;Example&lt;/a&gt; 📚 &lt;a href="https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-gatsby.md" rel="noopener noreferrer"&gt;Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F17si2f3o32qo6qd8yui1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F17si2f3o32qo6qd8yui1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this post I'll show you how to setup your (universal) Expo app to use &lt;a href="https://www.gatsbyjs.org/" rel="noopener noreferrer"&gt;Gatsby&lt;/a&gt; when targeting web! &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🚨 If you find bugs please report them on the &lt;a href="https://github.com/expo/expo-cli/issues" rel="noopener noreferrer"&gt;expo-cli repo&lt;/a&gt; with the &lt;code&gt;[gatsby]&lt;/code&gt; tag in the title.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Why use Gatsby with Expo?
&lt;/h3&gt;

&lt;p&gt;Here are the main benefits of doing this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can &lt;a href="https://www.netlify.com/blog/2016/11/22/prerendering-explained/" rel="noopener noreferrer"&gt;prerender&lt;/a&gt; the web part of your &lt;a href="http://expo.io/" rel="noopener noreferrer"&gt;Expo&lt;/a&gt; app.&lt;/li&gt;
&lt;li&gt;If you use Gatsby already, then now you can &lt;strong&gt;share most of your code between web and mobile&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If you're new to Expo then this also means that you can use complex browser features from the Expo SDK like Camera, Gestures, Permissions, etc. whenever possible in the browser!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ⚽️ Tutorial
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjv5tnc0p3nidvgoxb8pa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjv5tnc0p3nidvgoxb8pa.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install or update the Expo CLI: &lt;code&gt;npm i -g expo-cli&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a new Expo project: &lt;code&gt;expo init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Install the Gatsby plugin:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  # yarn
  yarn add gatsby gatsby-plugin-react-native-web

  # npm
  npm install --save gatsby gatsby-plugin-react-native-web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a &lt;code&gt;gatsby-config.js&lt;/code&gt; and use the plugin:
&lt;a href="https://github.com/expo/examples/blob/master/with-gatsby/gatsby-config.js" rel="noopener noreferrer"&gt;&lt;code&gt;gatsby-config.js&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
       &lt;span class="s2"&gt;`gatsby-plugin-react-native-web`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="cm"&gt;/* ... */&lt;/span&gt;
     &lt;span class="p"&gt;],&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add &lt;code&gt;/.cache&lt;/code&gt; and &lt;code&gt;/public&lt;/code&gt; to your &lt;a href="https://github.com/expo/examples/blob/3b7e4e33be382c87534b9fa49981fb9c4d793b23/with-gatsby/.gitignore#L16-L18" rel="noopener noreferrer"&gt;&lt;code&gt;.gitignore&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Now create the first page of your Gatsby project: 

&lt;ul&gt;
&lt;li&gt;Create the pages folder: &lt;code&gt;mkdir -p src/pages&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;Create the file:
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  # JS
  cp App.js src/pages/index.js

  # TS
  cp App.tsx src/pages/index.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;yarn gatsby develop&lt;/code&gt; to try it out!

&lt;ul&gt;
&lt;li&gt;Open the project in the browser &lt;code&gt;http://localhost:8000/&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fj0c01d6ra9ylwomy2d1o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fj0c01d6ra9ylwomy2d1o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Trouble Shooting
&lt;/h3&gt;

&lt;p&gt;If you started your project without the Expo CLI you may also need to do these things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you started your project with Gatsby CLI then check out the guide I wrote in the docs: &lt;a href="https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-gatsby.md#gatsby-projects-with-expo" rel="noopener noreferrer"&gt;Gatsby Project with Expo&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install React Native for Web: &lt;code&gt;yarn add react-native-web&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install the babel preset for React Native web:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  # yarn
  yarn add --dev babel-preset-expo
  # npm
  npm install --save-dev babel-preset-expo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;💡 Even though the name has Expo in it, you can (and should) use it for any React Native project as it provides universal platform support.

&lt;ul&gt;
&lt;li&gt;Create a &lt;code&gt;babel.config.js&lt;/code&gt; and use the Babel preset:
&lt;a href="https://github.com/expo/examples/blob/master/with-gatsby/babel.config.js" rel="noopener noreferrer"&gt;&lt;code&gt;babel.config.js&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;presets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;babel-preset-expo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🏁 New Commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Starting web&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🚫 &lt;code&gt;expo start:web&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;code&gt;yarn gatsby develop&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Building web&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🚫 &lt;code&gt;expo build:web&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;code&gt;yarn gatsby build&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Serving your static project&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🚫 &lt;code&gt;serve web-build&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;code&gt;yarn gatsby serve&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  📁 File Structure
&lt;/h3&gt;

&lt;p&gt;Here is the recommended file structure for a Expo project with Gatsby support.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Expo Gatsby
├── src
│   └── pages ➡️ Routes
│       └── index.tsx ➡️ Entry Point for Gatsby
├── .cache ➡️ Generated Gatsby files (should be ignored)
├── public ➡️ Generated Gatsby files (should be ignored)
├── assets ➡️ All static assets for your project
├── App.tsx ➡️ Entry Point for Mobile apps
├── app.json ➡️ Expo config file
├── gatsby-config.js ➡️ Gatsby config file
└── babel.config.js ➡️ Babel config (should be using `babel-preset-expo`)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  👋 Thanks for Reading
&lt;/h2&gt;

&lt;p&gt;I hope you found this article helpful! If you do use this workflow I'd love to hear about how it worked for you 😁 If you didn't, I'd also love to hear! So go tweet some emojis at me :]&lt;/p&gt;

&lt;h2&gt;
  
  
  📚 More Info
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/slorber/gatsby-plugin-react-native-web/pull/14" rel="noopener noreferrer"&gt;Expo support PR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/expo/examples/tree/master/with-gatsby" rel="noopener noreferrer"&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-gatsby.md" rel="noopener noreferrer"&gt;Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://baconbrix.gitbook.io/react-native-web/" rel="noopener noreferrer"&gt;Tips and Tricks for React Native web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=qNym3q6zCXo" rel="noopener noreferrer"&gt;Video: PWA vs Native (ft. Kyle from Gatsby and me)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>tutorial</category>
      <category>react</category>
      <category>gatsby</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Making Desktop apps with Electron, React Native, and Expo</title>
      <dc:creator>Evan Bacon</dc:creator>
      <pubDate>Tue, 26 Nov 2019 21:23:39 +0000</pubDate>
      <link>https://dev.to/evanbacon/making-desktop-apps-with-electron-react-native-and-expo-5e36</link>
      <guid>https://dev.to/evanbacon/making-desktop-apps-with-electron-react-native-and-expo-5e36</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;a href="https://github.com/expo/examples/tree/master/with-electron" rel="noopener noreferrer"&gt;Example&lt;/a&gt;. Expo + Electron is in alpha (Nov 2019). &lt;a href="https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-electron.md" rel="noopener noreferrer"&gt;docs = most recent info&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This tutorial will show you how to use React Native, Electron, Webpack, and the Expo SDK too create dope Desktop apps!&lt;/p&gt;

&lt;p&gt;Electron is a great way to make desktop apps, and possibly the easiest. Lots of popular apps like VSCode, Figma, Zeplin, &lt;a href="https://electronjs.org/apps" rel="noopener noreferrer"&gt;and many others are made with it!&lt;/a&gt; I like to think of it as a browser with extra native features like File System, Touch Bar, Menu Bar, Bluetooth, In-app Purchases. &lt;/p&gt;

&lt;p&gt;Another great framework is &lt;a href="http://expo.io/" rel="noopener noreferrer"&gt;Expo&lt;/a&gt;, you can use it to build mobile apps and websites with React. Expo for web works by using browser features with &lt;code&gt;react-native-web&lt;/code&gt; whenever it can, then failing gracefully when features aren't available. 🤔 But what if Expo for web had access to all of the same features as a native app? That would probably look something like "Expo for Desktop" 😮. &lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Tutorial
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5zk0kcug6lhwontqh2p8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5zk0kcug6lhwontqh2p8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TL;DR: &lt;a href="https://github.com/expo/examples/tree/master/with-electron" rel="noopener noreferrer"&gt;Here is an example repo.&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new Expo project with &lt;code&gt;expo init&lt;/code&gt; (you can select a TypeScript project from here if you want 🥰)

&lt;ul&gt;
&lt;li&gt;You may need to install or update the Expo CLI with &lt;code&gt;npm i -g expo-cli&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;This project by default can already run on iOS, Android, and web or as a PWA.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;cd&lt;/code&gt; into the project and run &lt;code&gt;yarn add -D @expo/electron-adapter&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;This has all of the tools used to run Electron with Expo.&lt;/li&gt;
&lt;li&gt;Notice that it's not built directly into Expo CLI (out-of-tree solution).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Now run &lt;code&gt;yarn expo-electron&lt;/code&gt; to bootstrap the project. Currently this does the following:

&lt;ul&gt;
&lt;li&gt;Install the required dependencies: &lt;code&gt;electron&lt;/code&gt;, &lt;code&gt;@expo/webpack-config&lt;/code&gt;, &lt;code&gt;react-native-web&lt;/code&gt;, etc...&lt;/li&gt;
&lt;li&gt;Create a new &lt;code&gt;electron-webpack&lt;/code&gt; config file &lt;code&gt;electron-webpack.js&lt;/code&gt; and 
wraps it in the method &lt;code&gt;withExpoAdapter&lt;/code&gt; which ensures that everything is setup correctly.&lt;/li&gt;
&lt;li&gt;Append electron generated files to the .gitignore&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Finally run &lt;code&gt;yarn expo-electron start&lt;/code&gt; to start the project!

&lt;ul&gt;
&lt;li&gt;Everything should just open automatically.&lt;/li&gt;
&lt;li&gt;You can view logs in the terminal.&lt;/li&gt;
&lt;li&gt;Quit with "ctrl+c" in the terminal or by closing the browser window.&lt;/li&gt;
&lt;li&gt;Make some changes to App.tsx to see the magic happen! 🧚‍♂️&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F10hvqnjgejomngt0l7bn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F10hvqnjgejomngt0l7bn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🎨 &lt;a href="https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-electron.md#customizing-the-main-process" rel="noopener noreferrer"&gt;Customizing the Main Process&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you're familiar with Electron you're probably wondering &lt;a href="https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes" rel="noopener noreferrer"&gt;"what about the main process?"&lt;/a&gt; (but without the hyperlink). &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Electron has 2 processes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;renderer process: which is where you'll write your React application code.&lt;/li&gt;
&lt;li&gt;main process: Think of the "main process" as the native code in a React Native process (but still written with JavaScript). It's mostly unaware of the code running in the "renderer process", it has access to a variety of different features like creating windows.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📚 How it works
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;By default your project uses a main-process that runs in a hidden folder (&lt;code&gt;node_modules/@expo/electron-adapter/...&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;To customize the main process (highly recommended) you can run &lt;code&gt;yarn expo-electron customize&lt;/code&gt; which will generate a folder &lt;code&gt;/electron&lt;/code&gt; in your root directory.&lt;/li&gt;
&lt;li&gt;You'll need to restart Electron for this new folder to become the new target.

&lt;ul&gt;
&lt;li&gt;Everything in &lt;code&gt;electron/main&lt;/code&gt; has hot-reloading enabled (!!) so that should make your life happier.&lt;/li&gt;
&lt;li&gt;the &lt;code&gt;electron/webpack.config.js&lt;/code&gt; can be used to modify the Webpack config for both processes (use values passed to the method to detect which is which).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  📂 File Structure
&lt;/h2&gt;

&lt;p&gt;|- &lt;code&gt;electron/&lt;/code&gt;&lt;br&gt;
|-- &lt;code&gt;webpack.config.js&lt;/code&gt;&lt;br&gt;
|-- &lt;code&gt;main/&lt;/code&gt; All main process code goes in here&lt;br&gt;
|--- &lt;code&gt;index.js&lt;/code&gt; Entry point for your main process&lt;br&gt;
|- &lt;code&gt;dist/&lt;/code&gt; Electron will generate files here, do not edit it directly.&lt;br&gt;
|- &lt;code&gt;electron-webpack.js&lt;/code&gt; Config file for the package &lt;code&gt;electron-webpack&lt;/code&gt; which is required to run your project.&lt;br&gt;
|- &lt;code&gt;App.tsx&lt;/code&gt; || &lt;code&gt;App.js&lt;/code&gt; The entry point of your renderer process, unless you change it in the &lt;code&gt;package.json&lt;/code&gt;&lt;br&gt;
|- &lt;code&gt;src/&lt;/code&gt; Not required, but you can put all of your renderer process code in here&lt;br&gt;
|- &lt;code&gt;assets/&lt;/code&gt; All static assets, images, fonts, icons, SVGs, videos, etc...&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚙️ Building your project
&lt;/h2&gt;

&lt;p&gt;At the time of writing this (Nov 2019) expo/electron-adapter doesn't provide any special building utils. But I've put together a guide for building a project with existing Electron packages: &lt;a href="https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-electron.md#building-your-project" rel="noopener noreferrer"&gt;Expo Docs: Building Electron apps&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🤭 Why Electron
&lt;/h2&gt;

&lt;p&gt;"Why not just use a fully native solution like OSX and react-native-windows?" the reason is ... why not both! 🥳 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw3qhkirtqmrhp2zzgiix.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw3qhkirtqmrhp2zzgiix.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the future want to deliver the optimal experience for every platform, but we also really appreciate the ability to choose your stack. So for now you can use Electron, but in the future there will probably be even better native workflows provided by Expo.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧸 &lt;a href="https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-electron.md#-behavior" rel="noopener noreferrer"&gt;Behavior&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Webpack now resolves files with &lt;code&gt;.electron.js&lt;/code&gt; &amp;amp; &lt;code&gt;.web.js&lt;/code&gt; extensions in that order. If you want to use electron features then put them in a file like &lt;code&gt;foo.electron.js.&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Every universal package you have installed will be transpiled automatically, this includes packages that start with the name: expo, @expo, @unimodules, @react-navigation, react-navigation, react-native. You can add more by appending them to the array for key &lt;code&gt;expo.web.build.babel.include&lt;/code&gt; in your &lt;code&gt;app.json&lt;/code&gt; (this feature is experimental and subject to change).&lt;/li&gt;
&lt;li&gt;I wrote the docs that I just blatantly lifted this section from :]&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  👋 Thanks so much
&lt;/h2&gt;

&lt;p&gt;That's all for now, to stay updated on new features feel free to follow me on Twitter, Github, Dev..ehh...&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
