<?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: Tia Eastwood</title>
    <description>The latest articles on DEV Community by Tia Eastwood (@tiaeastwood).</description>
    <link>https://dev.to/tiaeastwood</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%2F389003%2F717516f4-7eed-419f-9c18-a50a4fa4fc59.jpeg</url>
      <title>DEV Community: Tia Eastwood</title>
      <link>https://dev.to/tiaeastwood</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tiaeastwood"/>
    <language>en</language>
    <item>
      <title>📱 How To Set Up Your Android Development Environment (React Native &amp; Mac OS)</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Tue, 27 Jun 2023 11:47:36 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/how-to-set-up-your-android-development-environment-react-native-mac-os-p4h</link>
      <guid>https://dev.to/tiaeastwood/how-to-set-up-your-android-development-environment-react-native-mac-os-p4h</guid>
      <description>&lt;p&gt;I think there's a certain thrill about setting up a new machine...until you realize you need to remember how to configure your development environments all over again! After going through the steps myself, here's my guide on how to set up your Android development environment (in my case, specifically for React Native applications) on macOS. Whether you're setting up a fresh machine or just need a refresher, hopefully you'll find this guide helpful. Without further ado, let's dive right in...&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install Homebrew
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://brew.sh/"&gt;Homebrew&lt;/a&gt; is a package manager for macOS that simplifies the installation of software. &lt;/p&gt;

&lt;p&gt;If you haven't installed it yet, open Terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Install Node, Watchman, and Java
&lt;/h2&gt;

&lt;p&gt;Next you will need &lt;a href="https://nodejs.org/en"&gt;Node&lt;/a&gt; and &lt;a href="https://developers.facebook.com/blog/post/2021/03/15/eli5-watchman-watching-changes-build-faster/"&gt;Watchman&lt;/a&gt;. You'll also need Java. For node, I would highly recommend using &lt;a href="https://github.com/nvm-sh/nvm"&gt;NVM (Node Version Manager)&lt;/a&gt; to install node as it makes it much easier to manage different versions of node that you may need for different projects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can use Homebrew to install:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install nvm
// or if you don't want to use nvm:
brew install node
brew install watchman
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you decided to go with NVM, then install your preferred version of node now via NVM, or just the latest version with &lt;code&gt;nvm install node&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then &lt;a href="https://www.java.com/en/download/"&gt;download and install Java&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 3: Install Android Studio
&lt;/h2&gt;

&lt;p&gt;Download and install Android Studio from &lt;a href="https://developer.android.com/studio"&gt;https://developer.android.com/studio&lt;/a&gt;. During the setup, check the boxes for: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Android SDK&lt;/li&gt;
&lt;li&gt;Android SDK Platform&lt;/li&gt;
&lt;li&gt;Android Virtual Device&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the checkboxes are not visible, you'll be able to install these components later via the Android Studio's SDK Manager. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Configure the JAVA_HOME variable
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open Terminal.&lt;/li&gt;
&lt;li&gt;If you're using bash, all you have to do is:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;echo export "JAVA_HOME=\$(/usr/libexec/java_home)" &amp;gt;&amp;gt; ~/.bash_profile&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you're using zsh (which probably means you're running macOS Catalina or newer), then it should instead be:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;echo export "JAVA_HOME=\$(/usr/libexec/java_home)" &amp;gt;&amp;gt; ~/.zshrc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then restart the shell with &lt;code&gt;source ~/.bash_profile&lt;/code&gt; or &lt;code&gt;source ~/.zshrc&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 5: Configure the ANDROID_HOME Environment Variable
&lt;/h2&gt;

&lt;p&gt;React Native needs to know where your Android SDK is, which is achieved by setting the ANDROID_HOME environment variable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Terminal.&lt;/li&gt;
&lt;li&gt;To create the file if it doesn't exist, or open it if it does:

&lt;ul&gt;
&lt;li&gt;If you're using bash: &lt;code&gt;touch ~/.bash_profile&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;or if you're using zsh: &lt;code&gt;touch ~/.zshrc&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Then, run &lt;code&gt;open -e ~/.bash_profile&lt;/code&gt; to open the file in TextEdit.&lt;/li&gt;
&lt;li&gt;Add the following lines to the file and save it:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Back in the terminal, run &lt;code&gt;source ~/.bash_profile&lt;/code&gt; or &lt;code&gt;source ~/.zshrc&lt;/code&gt; to reload the profile.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 6: Create and Configure a Virtual Device
&lt;/h2&gt;

&lt;p&gt;You'll need an Android Virtual Device (AVD) to run your app.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Android Studio.&lt;/li&gt;
&lt;li&gt;Click on Device Manager in the top menu.&lt;/li&gt;
&lt;li&gt;Click on "Create Device" (if you want to test Play Store purchases, you need to select a device featuring Play Store)&lt;/li&gt;
&lt;li&gt;Choose a device definition and click "Next".&lt;/li&gt;
&lt;li&gt;Select a system image and click "Next"&lt;/li&gt;
&lt;li&gt;Verify the configuration and click "Finish".&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 7: Install React Native
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Follow the instructions on the &lt;a href="https://reactnative.dev/docs/environment-setup?guide=native"&gt;React Native docs&lt;/a&gt; (I'm using Bare React Native, but there are also instructions for Expo).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 8: Create a New Application
&lt;/h2&gt;

&lt;p&gt;You're all set! You can create a new React Native application by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;react-native init MyNewApp
// Replace "MyNewApp" with the name of your app.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run your React Native application on the Android Virtual Device:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure the AVD is running. You can check this in Android Studio's AVD Manager.&lt;/li&gt;
&lt;li&gt;In the Terminal or your code editor, run &lt;code&gt;npm start&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Then type "a" for Android &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Voila! I hope you're all set up and running now.&lt;/p&gt;

&lt;p&gt;Happy apping!&lt;/p&gt;




&lt;p&gt;Cover photo by Photo by &lt;a href="https://unsplash.com/@robman?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Rob Hampsono&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/cqFKhqv6Ong?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mobiledevelopment</category>
      <category>android</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>How To Set Up a New Project With React &amp; Capacitor.js</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Fri, 21 Apr 2023 17:13:22 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/how-to-set-up-a-new-project-with-react-capacitorjs-58pd</link>
      <guid>https://dev.to/tiaeastwood/how-to-set-up-a-new-project-with-react-capacitorjs-58pd</guid>
      <description>&lt;p&gt;&lt;a href="https://capacitorjs.com/"&gt;Capacitor&lt;/a&gt; is a tool that enables developers to make their frontend builds run on multiple platforms, including mobile (iOS and Android), desktop (Electron), and web (Progressive Web Applications). It also provides a high-quality API to work with native functions within apps, such as accessing the camera or device information.&lt;/p&gt;

&lt;p&gt;One of the benefits of Capacitor is that it is not tied to any particular UI framework, so you can use it with any existing web project, framework, or library. Developers using React in their Capacitor app have access to a set of useful, community-maintained &lt;a href="https://capacitorjs.com/docs/guides/react-hooks"&gt;React Hooks&lt;/a&gt; to access Capacitor APIs in their React function components. For example, you can use the useFilesystem hook to access the filesystem API. You can also extend Capacitor with your own native plugin APIs. &lt;/p&gt;

&lt;p&gt;Capacitor provides a solution for anyone wanting to create one application (or convert an existing site) to one that translates well on both desktop and mobile platforms. It was also something I needed to learn for a project recently, so I thought I'd share my setup tutorial with you... &lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisites
&lt;/h1&gt;

&lt;p&gt;To get started, you should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have some basic knowledge of &lt;a href="https://react.dev/"&gt;React&lt;/a&gt;, &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"&gt;JavaScript&lt;/a&gt;, ES6 syntax, the command line.&lt;/li&gt;
&lt;li&gt;Have installed &lt;a href="https://nodejs.org/en"&gt;Node&lt;/a&gt; and &lt;a href="https://capacitorjs.com/"&gt;Capacitor&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you want to run your app on iOS, you should have a macOS with &lt;a href="https://developer.apple.com/xcode/"&gt;Xcode&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you want to run your app on Android, you should install &lt;a href="https://developer.android.com/studio?gclid=CjwKCAjw6IiiBhAOEiwALNqncVZQxlZF8jlDPnp5VOSM6qrfqVE0n91P6mXPEnIs7N_ybEl_3K2puBoCf5cQAvD_BwE&amp;amp;gclsrc=aw.ds"&gt;Android Studio&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Setup
&lt;/h1&gt;

&lt;p&gt;The first step is to set up a new React project using the official create-react-app CLI tools. You can use the following commands in the terminal to create a basic React app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g create-react-app create-react-app react-with-capacitor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating the project, you need to open it and run it in development mode using the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd react-with-capacitor npm install npm run start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To add Capacitor to your project, you can install it using NPM with the following command inside the project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save @capacitor/cli @capacitor/core
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, you need to initialize Capacitor with information about the application. For example, I will give the app a name of react-capacitor-example, and I want the app package ID to be com.example.reactCapacitor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx cap init react-with-capacitor com.example.reactCapacitor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will complete in the terminal and you'll see a prompt asking you if you want to create a free Ionic account, which you can just skip for now if you want. You should now have a capacitor.config.json file that looks like this:&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;CapacitorConfig&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;@capacitor/cli&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;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;CapacitorConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
   &lt;span class="na"&gt;appId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;com.example.reactCapacitor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;appName&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-with-capacitor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;webDir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;bundledWebRuntime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&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;config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now install the platforms you would like to develop for such as iOS or Android:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @capacitor/ios
npm install @capacitor/android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then build the project and add it to the iOS or Android platform using the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build
// for ios
npx cap add ios
// for android
npx cap add android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the above steps, you should see an ios and/or android folder in your project! Sweet!&lt;/p&gt;

&lt;h1&gt;
  
  
  Running the Project
&lt;/h1&gt;

&lt;p&gt;Now that your project is set up, you can run it to check that all is working as it should be. To run it as a React app in your browser, just run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;To run on iOS:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Xcode and select open a new project&lt;/li&gt;
&lt;li&gt;In the finder that opens, navigate to the iOS folder in your project, go in the App folder, then open the .xcworkspace file - Once open, press the play button at the top of xcode and select an emulator to open&lt;/li&gt;
&lt;li&gt;You should now see your Capacitor app load in the emulator! &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;To run on Android:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Android Studio, choose to open an existing project and select your project folder&lt;/li&gt;
&lt;li&gt;Start a new emulator&lt;/li&gt;
&lt;li&gt;Select the "Run app" button (looks like a play button) from the top menu&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You should now see your Capacitor app load in the emulator! &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Capacitor doesn't have hot reload working out of the box, but you can install &lt;a href="https://capacitorjs.com/docs/guides/live-reload"&gt;Live Reload&lt;/a&gt; to make your development process easier.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;And that's how you set up a new project with React and Capacitor! I hope that was helpful, and be sure to check out the official &lt;a href="https://capacitorjs.com/"&gt;documentation&lt;/a&gt; to see what else you can do with it&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>mobiledevelopment</category>
    </item>
    <item>
      <title>5 of the Most EXCITING AI-Powered Tools for Software Developers</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Tue, 18 Apr 2023 16:02:22 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/5-of-the-most-exciting-ai-powered-tools-for-software-developers-569h</link>
      <guid>https://dev.to/tiaeastwood/5-of-the-most-exciting-ai-powered-tools-for-software-developers-569h</guid>
      <description>&lt;p&gt;Oh no, AI is coming to take our jobs! Well, hopefully not! Instead, let's learn to use AI to improve the way we work! I'm very excited about the following tools right now... &lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://www.phind.com/"&gt;Phind&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Phind is particulary exciting to me because it's an AI-powered search engine designed for developers. It is powered by large language models like GPT-4 in order to provide answers, explanations and examples based on your search question. A typical response will be an article based on sources from all over the web, with citations included to back up the information, a bit like a dissertation. &lt;/p&gt;

&lt;h3&gt;
  
  
  Why it's Useful
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Quickly recieve an extremely readable answer in seconds&lt;/li&gt;
&lt;li&gt;See a list of sources so you can do further reading&lt;/li&gt;
&lt;li&gt;Saves time that you might usually spend Googling or searching StackOverflow&lt;/li&gt;
&lt;li&gt;You can tailor your search response to be more "expert", "concise" or "creative" in order to be more specific or not rely on web results at all. &lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  &lt;a href="https://www.tabnine.com/"&gt;Tabnine&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Tabnine is an AI code assistant that is designed to help developers write code faster and more efficiently. According to tabnine.com, Tabnine uses AI to train a model based on a developer's specific code patterns, and then provides whole-line and full-function code completions based on that model. I really enjoy using Tabnine in my VS Code as having smart code completion helps me to work a lot faster and generally improves me productivity as a result. &lt;/p&gt;

&lt;h3&gt;
  
  
  Why it's Useful:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Free plan available.&lt;/li&gt;
&lt;li&gt;supports all programming languages and IDEs.&lt;/li&gt;
&lt;li&gt;Gets to know your specific code patterns, so the autocompletion is what you would expect. &lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  &lt;a href="https://github.com/features/copilot"&gt;Github Copilot&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;An AI pair programmer that makes suggestions in real time. Github.com states: "Spend less time creating boilerplate and repetitive code patterns, and more time on what matters: building great software. Write a comment describing the logic you want and GitHub Copilot will immediately suggest code to implement the solution." It costs $10 for the individual plan, but you can get a free trial. I've been giving the trial a go myself and I'm honestly blown away by the intelligence of the suggestions. Sometimes it knows exactly what to suggest purely from the name I've given to the function, or my pseudo-code comments! &lt;/p&gt;

&lt;h3&gt;
  
  
  Why it's Useful
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;AI based code suggestions based on your projects context and style conventions. &lt;/li&gt;
&lt;li&gt;Accept, reject or edit any of the suggestions (and get alternative suggestions).&lt;/li&gt;
&lt;li&gt;Especially useful if you're working in a language you're not that familiar with yet; helps you to learn as you code.&lt;/li&gt;
&lt;li&gt;Easily accessible as an extension for Visual Studio Code, Visual Studio, Neovim, and the JetBrains suite of integrated development environments (IDEs). &lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  &lt;a href="https://www.askcodi.com/"&gt;Ask Codi&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;This is a really interesting one! According to askcodi.com: "AskCodi provides a complete tool that can be used by developers during the development process." It has many different tools that are useful for developers, whether you're a beginner or more experienced.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why it's Useful:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The web version has really nice user-friendly UI. - Free to use (no credit card required, yay!) either in your web browser or as a code editor extension.&lt;/li&gt;
&lt;li&gt;So many different AI-powered tools! Intelligent chat bot, code generation, explanations, documentation, generate tests, database queries, script generators...and more! - Saves your previous code generations / queries in a codebase so you can come back to them later.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;...and of course, no list would be complete without: &lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://chat.openai.com/"&gt;ChatGPT&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;GPT4 in particular can assist you with just about almost anything, from code explanations, to name ideas for your app, to helping you write documentation. Just remember that it has a knowledge cutoff as of September 2021, so asking it about anything newer won't yield a great result.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why it's Useful:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Has a free tier, so is available to anyone.&lt;/li&gt;
&lt;li&gt;Great for generating a lot of ideas quickly and prompting creativity.&lt;/li&gt;
&lt;li&gt;A a developer, it can be useful as a helper for writing code, or even explaining existing code to aid in your understanding.&lt;/li&gt;
&lt;li&gt;Automate mundane and time-consuming tasks like generating a spreadsheet or putting a lot of items into a list.&lt;/li&gt;
&lt;li&gt;The possibilities already seem endless and we're just getting started!&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;There we have it! These are the top 5 AI powered tools that I've found myself using the most recently. They've saved me time, assisted my productivity and overall made me really excited about how I can use technology to improve the way I work! Go and try them out and let me know what you think! :)&lt;/p&gt;

</description>
      <category>ai</category>
      <category>openai</category>
      <category>programming</category>
      <category>career</category>
    </item>
    <item>
      <title>🧪 How To Test an Image Component Using React Native Testing Library</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Thu, 30 Mar 2023 11:21:16 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/how-to-test-an-image-component-using-react-native-testing-library-3on4</link>
      <guid>https://dev.to/tiaeastwood/how-to-test-an-image-component-using-react-native-testing-library-3on4</guid>
      <description>&lt;p&gt;&lt;a href="https://callstack.github.io/react-native-testing-library/"&gt;React Native Testing Library&lt;/a&gt; and &lt;a href="https://testing-library.com/docs/react-testing-library/intro/"&gt;React Testing Librar&lt;/a&gt;y are both libraries that provide utilities for testing React components. However, they differ in their scope and implementation. &lt;/p&gt;

&lt;h2&gt;
  
  
  React Native Testing Library
&lt;/h2&gt;

&lt;p&gt;React *Native* Testing Library a library specifically designed for testing React Native components (mobile). It provides a set of tools for testing React Native components in a way that is similar to how users interact with them in the mobile app. This means that it focuses on the functionality of the components, rather than their implementation details. The library uses a similar API to React Testing Library, but with some differences to account for the unique features of React Native.&lt;/p&gt;

&lt;h2&gt;
  
  
  React Testing Library
&lt;/h2&gt;

&lt;p&gt;React Testing Library on the other hand, is a library designed for testing React components in a browser environment. It provides a set of tools for testing React components in a way that is similar to how users interact with them in a browser. This means that it also focuses on the functionality of the components, rather than their implementation details.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Differences
&lt;/h2&gt;

&lt;p&gt;One key difference between the two libraries is that React Native Testing Library includes support for native components like View, Text, Image, etc., while React Testing Library only supports web-based components like div, span, img, etc. This can make things a bit challenging at first when trying to write the tests for your React Native app! One thing I found a bit tricky at first was images, but here is a way that works for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Test An Image Component!
&lt;/h2&gt;

&lt;p&gt;Below is an example of a component from a Movie app. This MovieCard component shows on the screen and displays details about a movie, such as an image, the title, genre and the release date.&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="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="s2"&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;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;Image&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="s2"&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;import&lt;/span&gt; &lt;span class="nx"&gt;styles&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./MovieCard.styles&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;MovieCardProps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;genre&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;release&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&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;MovieCard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;genre&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;release&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;MovieCardProps&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;movieCardContainer&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Image&lt;/span&gt;
                &lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;
                &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;movieCardImage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="nx"&gt;testID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;movie-image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;accessibilityRole&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;

            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;movieInfoContainer&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;movieCardTitle&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="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;genre&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;release&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MovieCard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;What I'm focusing on right now is testing that the &lt;a href="https://reactnative.dev/docs/image"&gt;Image&lt;/a&gt; component shows the movie image as expected. Notice I've added testID and an accessibilityRole properties to the Image component; we're going to use those in the test...&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;render&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="s2"&gt;@testing-library/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;import&lt;/span&gt; &lt;span class="nx"&gt;MovieCard&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./MovieCard&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// I've created some mock props, including a real image uri from the internet. These props are passed into the MovieCard component that's rendered below in the test.&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mockMovieCardProps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://images.unsplash.com/photo-1598899134739-24c46f58b8c0?ixlib=rb-4.0.3&amp;amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;amp;auto=format&amp;amp;fit=crop&amp;amp;w=2312&amp;amp;q=80&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test movie title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;genre&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test genre&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test release date&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;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;MovieCard /&amp;gt;&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;renders with expected details&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="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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;getByTestId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;getByRole&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;MovieCard&lt;/span&gt;
                &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;mockMovieCardProps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;mockMovieCardProps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="nx"&gt;genre&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;mockMovieCardProps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;genre&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="nx"&gt;release&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;mockMovieCardProps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;release&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;,
&lt;/span&gt;        &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// 1. testing the image exists by checking the testId:&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getByTestId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;movie-image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// 2. checking the image has the correct properties by accessing the props:&lt;/span&gt;
        &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&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="nx"&gt;accessibilityRole&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&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="nx"&gt;source&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mockMovieCardProps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;image&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;ol&gt;
&lt;li&gt;The first way we can check that our image has been rendered is by checking that the testID exists.&lt;/li&gt;
&lt;li&gt;Then we can get more specific and check that the image has rendered with the correct properties. The Image data is an object, you can access it's properties like img.props.source.uri - this way we can check that it's rendering the correct image based on the source...useful!&lt;/li&gt;
&lt;li&gt;Also if you've given the component an accessibilityRole property, you can access that in a similar way (img.props.accessibilityRole). &lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;So there are some ways that you can test your Image component in React Native! Let me know if you have any good tips of your own :)&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>react</category>
      <category>testing</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Retooling for Success: How I Made the Transition to Software Development in My 30s</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Tue, 28 Mar 2023 10:42:04 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/retooling-for-success-how-i-made-the-transition-to-software-development-in-my-30s-1i0f</link>
      <guid>https://dev.to/tiaeastwood/retooling-for-success-how-i-made-the-transition-to-software-development-in-my-30s-1i0f</guid>
      <description>&lt;p&gt;Hi there, I'm Tia, and I'd like to share with you my journey of becoming a software developer. &lt;/p&gt;

&lt;p&gt;Growing up, I was always a creative kid. I loved to draw and make things and that's what I was good at. In fact, it was the only thing I *thought* I was really good at. In the back of my mind, I always had an interest in technology too, but I never thought of pursuing it as a career. Instead, I pursued a degree in Illustration with Animation and embarked on following my dream of being an illustrator and product designer. I enjoyed making freelance art and designing products for my online shop and comic con artist booth, but ultimately it was hard to make a living that way. I was also fiercely independant and spent many years working in jobs I hated in order to pay the rent and not have to rely on anyone. Over time I became exhausted and, deep down, I knew something was missing. &lt;/p&gt;

&lt;p&gt;As I entered my thirties, I started to feel restless. I had no career really to speak of and I began to question whether I was truly fulfilled in my life. Eventually 2020 rolled around and Covid creeped onto the scene. I took this as a sign to shake things up and, with the support of my amazing partner, I decided to take a leap of faith and follow my other passion for technology. I started by learning coding on my own, watching online tutorials, reading books, and practicing every chance I got. Making something from code, was the most creative I'd ever felt. The more I learned, the more excited I became about the possibilities that software development offered. &lt;/p&gt;

&lt;p&gt;I was determined to make a career change, but I knew it wouldn't be easy. I was older than most people who were starting out in the field, and I lacked a computer science degeree or any relevant experience. However, I didn't let that discourage me. Instead, I worked harder than ever before. I quit my call center job and threw myself into learning full time, enrolling in a 14-week coding bootcamp to quickly get up to speed. Bootcamp wasn't easy because, due to the Covid lockdown, we had to complete it entirely remotely...little did I know though that this would be very useful practice for the future. &lt;/p&gt;

&lt;p&gt;I also reached out to people on social media and shared my journey. It's a good technique to "learn in public". What I mean by that is by sharing your challenges and achievements with other people, you're holding yourself accountable. Also the support and encouragement I received from other people was invaluable to me. &lt;/p&gt;

&lt;p&gt;Finally, my hard work paid off. After graduating from bootcamp, I landed my first job as a software developer, and I couldn't have been happier. I was very nervous and didn't have a lot of confidence in myself to begin with. I battled with imposter syndrome, but I had to try and keep thinking back to how hard I worked to get here. Of course, you also have to remain humble and remember that you'll never know it all; there's always something new to learn in a career as a software developer, but that's what makes it so exciting to me. &lt;/p&gt;

&lt;p&gt;Looking back, I'm so grateful that I took that leap of faith and pursued my passion for technology. It was scary at first, but it's been so rewarding. I hope my story inspires others who may be considering a career change later in life. It's never too late to follow your dreams and pursue what truly makes you happy.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Expo vs bare React Native…the Pros and Cons</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Mon, 27 Mar 2023 17:32:43 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/expo-vs-bare-react-nativethe-pros-and-cons-eaj</link>
      <guid>https://dev.to/tiaeastwood/expo-vs-bare-react-nativethe-pros-and-cons-eaj</guid>
      <description>&lt;p&gt;&lt;a href="https://reactnative.dev/"&gt;React Native&lt;/a&gt; is one of the most popular cross-platform mobile app development frameworks. It is an open-source platform that allows developers to create mobile applications using the same programming language and logic as for web development. There are two popular ways to use React Native, either by using the bare minimum React Native or using &lt;a href="https://expo.dev/"&gt;Expo&lt;/a&gt;. Both have their advantages and disadvantages and that's what we're going to look at this article...&lt;/p&gt;

&lt;h2&gt;
  
  
  Bare React Native
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Pros:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;More Control:&lt;/strong&gt; Bare React Native gives you complete control over your project. You can customize your application as per your needs and preferences. You can add and remove features, libraries, and modules as required. This level of control is not available with Expo, which comes with pre-built components and libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Better Performance:&lt;/strong&gt; Bare React Native apps have better performance than Expo apps. This is because Expo comes with pre-built components that can slow down the application. With bare React Native, you can optimize your code and have more control over the app's performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexibility:&lt;/strong&gt; Bare React Native offers more flexibility than Expo. You can use third-party libraries and components easily, which may not be possible with Expo. This flexibility allows you to customize your application to a greater extent.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cons:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Steep Learning Curve:&lt;/strong&gt; Bare React Native requires more in-depth knowledge of React and native mobile app development than Expo. The setup and configuration process can be complicated and time-consuming for beginners.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tedious Setup:&lt;/strong&gt; Setting up a bare React Native project can be a tedious process, as it involves installing and configuring several packages, including native modules, libraries, and tools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mac Required:&lt;/strong&gt; To develop using bare React Native, you need a Mac since you need to use &lt;a href="https://appleinsider.com/inside/xcode"&gt;Xcode&lt;/a&gt;, which is only available on Apple OS.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Expo
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Pros:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy to Use:&lt;/strong&gt; Expo is easy to use, even for beginners. It even feels pretty natural if you've already spent a lot of time using React. Expo provides pre-built components and libraries that you can use to build your application, plus a simple setup and configuration process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster Development:&lt;/strong&gt; With Expo, you can develop mobile applications faster than with bare React Native. The pre-built components and libraries save development time, and the hot reloading feature makes it easy to see the changes you make instantly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Publishing:&lt;/strong&gt; Creating a build ready for the app store is a fairly simple process using &lt;a href="https://docs.expo.dev/eas/"&gt;EAS&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Available To Everyone:&lt;/strong&gt; You don't need a Mac to develop an ios app using Expo. You can create an app that will work on both ios or Android, whithout even needing to run a simulator, since you can use the &lt;a href="https://expo.dev/client"&gt;Expo Go&lt;/a&gt; app on your mobile device.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cons:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limited Control:&lt;/strong&gt; Expo comes with pre-built components and libraries, which means you have limited control over the application's features and functionality. This can be a drawback if you want to customize your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limited Flexibility:&lt;/strong&gt; Since Expo comes with pre-built components, you may not be able to use third-party libraries and components that are not compatible with Expo.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt; Expo may have slower performance than bare React Native because of the pre-built components and libraries that come with it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;When You Don't Want Expo Any More:&lt;/strong&gt; Removing Expo and changing your app to bare React Native at a later date can be frustrating and time consuming.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  In Conclusion
&lt;/h2&gt;

&lt;p&gt;Bare React Native and Expo both have their advantages and disadvantages. If you have experience in native mobile app development and want more control and flexibility over your application, bare React Native is the way to go. However, if you are a beginner or want to develop mobile applications faster and easier, then Expo is the better choice. Ultimately, the choice between the two depends on your specific requirements and preferences.&lt;/p&gt;

&lt;p&gt;My personal recommendation would be to start out with Expo if you're new to learning React Native. Once you feel comfortable and familiar with React Native concepts, then switch to bare workflow. That's what I did 😃&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>expo</category>
      <category>mobiledevelopment</category>
    </item>
    <item>
      <title>5 Ways AI Could Impact The Future of Software Engineers</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Fri, 10 Mar 2023 10:15:28 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/5-ways-ai-could-impact-the-future-of-software-engineers-80e</link>
      <guid>https://dev.to/tiaeastwood/5-ways-ai-could-impact-the-future-of-software-engineers-80e</guid>
      <description>&lt;p&gt;Artificial Intelligence (AI) is rapidly evolving, and having a noticeable impact across many industries, including software engineering. As a developer myself, I'm always interested in the possibilities of new tech, but I started thinking about what kind of affect it could have on the industry I work in. AI can seem like a scary concept to some (is Skynet going to rise up and destry the world!?) however, society wouldn't be where it is today without the evolution of technology. As AI continues to evolve, it has the potential to transform the way software engineers work and the tools that they use. Here are five things that the future of AI could change for software engineers... &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Intelligent Automation
&lt;/h3&gt;

&lt;p&gt;Automation has been an essential part of software engineering for many years, but the future of AI is likely to bring about a new era of intelligent automation. Intelligent automation involves using AI to automate complex tasks, such as code generation and optimization. By automating these tasks, software engineers can focus on more strategic work and deliver higher-quality software products in less time. &lt;/p&gt;

&lt;h3&gt;
  
  
  2. Improved Software Maintenance
&lt;/h3&gt;

&lt;p&gt;Maintaining and updating software can be a time-consuming and challenging task, particularly as software systems become more complex. However, AI-powered systems could be used to analyze code and detect potential issues before they become significant problems. This will make it easier for software engineers to identify and fix bugs and vulnerabilities, reducing the risk of downtime and improving overall software performance. &lt;/p&gt;

&lt;h3&gt;
  
  
  3. Collaboration Between Humans &amp;amp; Machines
&lt;/h3&gt;

&lt;p&gt;AI systems are becoming increasingly sophisticated, but they still lack the creativity and problem-solving abilities of humans. In the future, software engineers are likely to work alongside AI systems, collaborating to achieve better outcomes. This will require software engineers to develop a new set of skills, including the ability to communicate effectively with machines and work collaboratively to solve complex problems. That sounds pretty cool, right? &lt;/p&gt;

&lt;h3&gt;
  
  
  4. Engineers With New Skills
&lt;/h3&gt;

&lt;p&gt;One of the most significant changes that AI will bring to the software engineering profession is the need for engineers to be proficient in machine learning (ML) and data science. Machine learning is a subset of AI that involves training machines to learn from data, rather than being explicitly programmed. As more applications are developed using ML, software engineers will need to have a solid understanding of ML algorithms, statistical methods, and data analysis techniques. So perhaps, existing software engineers will be inspired to acquire these skills, or maybe some people will find new inspiration for training for a career in software engineering. &lt;/p&gt;

&lt;h3&gt;
  
  
  5. New Job Opportunities
&lt;/h3&gt;

&lt;p&gt;As AI becomes more widespread, it also raises concerns about the impact it will have on the job market. There are concerns that AI might make some jobs redundant, but realistically AI will also create new job opportunities in areas such as machine learning, data science, and software development. There will be more demand for software engineers who have the skills and experience required to work with AI-powered technology. &lt;/p&gt;

&lt;p&gt;In conclusion, the future of AI is exciting, but it can also present challenges for software engineers. No one is forcing you to embrace it or change the way you work, however by not adapting we could miss out on some exciting opportunities. We may need to develop new skills, but that's just part of being a software engineer. However, with a willingness to learn, we can surely take advantage of the many opportunities that AI is likely to create in the not-too-distant future.&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>🧪 How to Mock and Test AsyncStorage in React Native</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Thu, 19 Jan 2023 16:05:21 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/how-to-mock-and-test-asyncstorage-in-react-native-4kil</link>
      <guid>https://dev.to/tiaeastwood/how-to-mock-and-test-asyncstorage-in-react-native-4kil</guid>
      <description>&lt;p&gt;Since the original &lt;a href="https://reactnative.dev/docs/asyncstorage" rel="noopener noreferrer"&gt;React Native AsyncStorage&lt;/a&gt; was deprecated, you may be using the community solution: &lt;a href="https://react-native-async-storage.github.io/async-storage/" rel="noopener noreferrer"&gt;react-native-async-storage&lt;/a&gt;. I would personally recommend it!&lt;/p&gt;

&lt;p&gt;Once you start writing your unit tests with Jest &amp;amp; React Native Testing Library, you'll notice that initially you will get an error about async storage when we run the tests. Something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Test suite failed to run

    [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OK! All you need to do is to mock AsyncStorage...&lt;/p&gt;

&lt;p&gt;If you don't already have a test setup file, then create one and add the following jest mock:&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="c1"&gt;// setupTests.js&lt;/span&gt;

&lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@react-native-async-storage/async-storage&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="o"&gt;=&amp;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;@react-native-async-storage/async-storage/jest/async-storage-mock&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;p&gt;This mock comes from the &lt;a href="https://react-native-async-storage.github.io/async-storage/" rel="noopener noreferrer"&gt;react-native-async-storage&lt;/a&gt; library and you can read more about it &lt;a href="https://react-native-async-storage.github.io/async-storage/docs/advanced/jest" rel="noopener noreferrer"&gt;here&lt;/a&gt; on their docs.&lt;/p&gt;

&lt;p&gt;Now make sure you reference you setupTest.js file in your package.json like this, so that it actually gets used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"jest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"preset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"jest-expo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"setupFiles"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./setupTests.js"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"transformIgnorePatterns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)|@react-native-async-storage/async-storage"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the previous error should be gone and you can now test the behaviour of your AsyncStorage actions! &lt;/p&gt;

&lt;p&gt;For example, you might have a todo list app that stores new todo items in AsyncStorage, then whenever you load up the app it gets all the items from AsyncStorage and displays them. Here is an example of a test covering the following scenario:&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="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="s2"&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;render&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;waitFor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;fireEvent&lt;/span&gt;&lt;span class="p"&gt;,&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="s2"&gt;@testing-library/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;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../App.tsx&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="nx"&gt;AsyncStorage&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@react-native-async-storage/async-storage&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="nx"&gt;renderer&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-test-renderer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useFakeTimers&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;itemData&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="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test item&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="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;another&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="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;and another&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="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;App /&amp;gt;&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;beforeEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &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;jsonValue1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;itemData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&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;jsonValue2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;itemData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&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;jsonValue3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;itemData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;AsyncStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;itemData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;jsonValue1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;AsyncStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;itemData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;jsonValue2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;AsyncStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;itemData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;jsonValue3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nf"&gt;waitFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;AsyncStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getAllKeys&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="nf"&gt;waitFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;AsyncStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAllKeys&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1&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="s2"&gt;2&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="s2"&gt;3&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;getAllKeys is called on render and items from async storage are displayed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &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="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&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;item1&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;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test item&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;item2&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;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;another&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;item3&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;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;and another&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;falseItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;i shouldn't exist&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeTruthy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item2&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeTruthy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item3&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeTruthy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;falseItem&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeFalsy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;new todo item is rendered to the displayed list when added&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &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="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&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;input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByPlaceholderText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;new todo...&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;addTodoBtn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ADD TODO&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;fireEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;onChangeText&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="s2"&gt;New Task&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;fireEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;addTodoBtn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;press&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nf"&gt;waitFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;New Task&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeTruthy&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="p"&gt;});&lt;/span&gt;


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

&lt;/div&gt;



&lt;p&gt;I have imported AsyncStorage at the top of the file and included a beforeEach that adds my mock data to Async Storage before the tests. Now I can interact with it, just like I would in the real app. &lt;/p&gt;

&lt;p&gt;You can also see the full repo for the todo list project &lt;a href="https://github.com/tiaeastwood/react-native-todo-app" rel="noopener noreferrer"&gt;here&lt;/a&gt; - credit also goes to the Net Ninja for teaching me how to create a todo list app within his tutorial &lt;a href="https://www.youtube.com/watch?v=ur6I5m2nTvk&amp;amp;list=PL4cUxeGkcC9ixPU-QkScoRBVxtPPzVjrQ" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you have any tips or suggestions of your own, then feel free to comment!&lt;/p&gt;

&lt;p&gt;Happy testing! &lt;/p&gt;

</description>
      <category>html</category>
    </item>
    <item>
      <title>🧪 How to set up Jest &amp; React Native Testing Library in your Expo App! 💥</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Wed, 18 Jan 2023 13:50:05 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/how-to-set-up-jest-react-native-testing-library-in-your-expo-app-p3e</link>
      <guid>https://dev.to/tiaeastwood/how-to-set-up-jest-react-native-testing-library-in-your-expo-app-p3e</guid>
      <description>&lt;p&gt;If you've used React Testing Library in a regular React project before then the React Native version will already seem familiar, however getting everything setup and configured is usually the trickiest part!&lt;/p&gt;




&lt;h2&gt;
  
  
  What we'll be using:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://callstack.github.io/react-native-testing-library/"&gt;React Native Testing Library&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/react-test-renderer"&gt;react-test-renderer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.expo.dev/guides/testing-with-jest/"&gt;Jest&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A React Native &lt;a href="https://docs.expo.dev/"&gt;Expo&lt;/a&gt; project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create a new one if you don't have one to work on already. &lt;a href="https://docs.expo.dev/tutorial/create-your-first-app/"&gt;See the Expo docs on creating a new project&lt;/a&gt;)&lt;/p&gt;




&lt;h2&gt;
  
  
  Installing React Native Testing Library.
&lt;/h2&gt;

&lt;p&gt;Go ahead and install React Native Testing Library. I'm using &lt;strong&gt;npx expo install&lt;/strong&gt; since I'm using Expo:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx expo install @testing-library/react-native -- --save-dev&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  Installing react-test-renderer
&lt;/h2&gt;

&lt;p&gt;We'll also need to install &lt;a href="https://www.npmjs.com/package/react-test-renderer"&gt;react-test-renderer&lt;/a&gt;, as React Native Testing Library uses it as a dependency. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt; Before you install it, look in your package.json and check what version of react you are using. You need to install the same version of react-test-renderer for compatibility. For example, I'm using &lt;strong&gt;"react": "18.1.0"&lt;/strong&gt; - Therefore I need to install &lt;strong&gt;"react-test-renderer": "18.1.0"&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx expo install react-test-renderer@18.1.0&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  Installing Jest
&lt;/h2&gt;

&lt;p&gt;Finally, go ahead and &lt;a href="https://docs.expo.dev/guides/testing-with-jest/"&gt;follow the instructions to install jest here&lt;/a&gt;.&lt;br&gt;
Be sure to add the configuration to your package.json&lt;/p&gt;




&lt;h2&gt;
  
  
  Test Examples
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//App.test.js&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;renderer&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-test-renderer&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;render&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="s2"&gt;@testing-library/react-native&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;App /&amp;gt;&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;has 1 child&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="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;tree&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toJSON&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;renders correctly&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="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;tree&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toJSON&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tree&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toMatchSnapshot&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;renders Hello World message on the home page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&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="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, World!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;toBeDefined&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="c1"&gt;// NOTE: You can use either:&lt;/span&gt;
&lt;span class="c1"&gt;// renderer.create(&amp;lt;App /&amp;gt;) from  "react-test-renderer"&lt;/span&gt;
&lt;span class="c1"&gt;// or render(&amp;lt;App /&amp;gt;) from "@testing-library/react-native"&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The above tests are based on a super simple app with only one child. If you have a more complex app with additional libraries, then there may be more setup required, and I will go into these scenarios in more detail in future articles. &lt;/p&gt;

&lt;p&gt;Please feel free to comment anything useful or interesting you've found when setting up testing on your Expo project.&lt;/p&gt;

&lt;p&gt;Happy testing! &lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>testing</category>
      <category>tutorial</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Super Simple CSS animation for "fade in" on page load 👻</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Sun, 15 Jan 2023 18:55:06 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/super-simple-css-animation-for-fade-in-on-page-load-2p8m</link>
      <guid>https://dev.to/tiaeastwood/super-simple-css-animation-for-fade-in-on-page-load-2p8m</guid>
      <description>&lt;p&gt;You've probably seen this one before...some websites have that really nice animation where things just fade in when you load the page. There are plenty of libraries out there that can help you achieve this, but if you just want to use a CSS approach, then you can try this out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@keyframes fadeInUp {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0%);
    opacity: 1;
  }
}

.fadeInUp-animation {
  animation: 1.5s fadeInUp;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Keyframes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Using @keyframes, we can create our animation (I've called this 'fadeInUp' but you can call it what you want) and decide what you want it to do.&lt;/li&gt;
&lt;li&gt;So I want a transform animation because I want to make something move. &lt;/li&gt;
&lt;li&gt;I use translateY to move it along the Y axis and initially I want it to be pushed down from its initial position and I want it to be transparent (opacity: 0).&lt;/li&gt;
&lt;li&gt;Then as it moves up the axis, it will become visible (opacity: 1).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Create the class
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Then I created the .fadeInUp-animation class, which lets me control the speed of the animation. &lt;/li&gt;
&lt;li&gt;You can then attach this class to any element you want to be animated, like text, an image, or even a whole div!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have a play around and see what else you can do with it :)&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/tiaeastwood/embed/KKBvqrg?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Some more places you can learn about CSS animations&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation"&gt;MDN docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/almanac/properties/a/animation/"&gt;CSS Tricks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/css/css3_animations.asp"&gt;W3 Schools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Host Your Website for Free on Netlify (&amp; Keep Your Github Repo Private)</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Mon, 21 Nov 2022 15:52:56 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/how-to-host-your-website-for-free-on-netlify-keep-your-github-repo-private-5ck6</link>
      <guid>https://dev.to/tiaeastwood/how-to-host-your-website-for-free-on-netlify-keep-your-github-repo-private-5ck6</guid>
      <description>&lt;p&gt;&lt;strong&gt;TLDR: On free Github, you can't host your website on Github Pages AND keep your repository private. You can pay to upgrade Github if you want, but I will show you how you can host it on Netlify instead.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Recently I built a new personal website which I wanted to publish, but I also wanted to keep the repository private. I use Github to store my code, so usually I would use Github pages to publish my site. However on the free version of Github, you can't publish your site on Github Pages AND keep your repo private; you have to upgrade and pay for that. &lt;/p&gt;

&lt;p&gt;Well I didn't want to pay 😄 but luckily &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; is super easy and free!&lt;/p&gt;

&lt;p&gt;Set up an account with &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; if you don't have one already. Just select the starter option which is free and you can set up a new 'team' to start with. I just set up a team of me 😁&lt;/p&gt;

&lt;p&gt;Once that was all set up, I went ahead and selected "Add new site". &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81j9wiiallivfoyo34cx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81j9wiiallivfoyo34cx.png" alt="Screenshot of Netlify Dashboard" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I went with "Import an existing project":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8oec1ehb39ve6z67dpcm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8oec1ehb39ve6z67dpcm.png" alt="Options displayed when you click add new site" width="292" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose your Git provider (I'm going with Github of course) and it will take your through the process of connecting to your account and then a list of all your repos (even the private ones) will be available for you to choose from.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw8qouco8gzt0p4nh1otl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw8qouco8gzt0p4nh1otl.png" alt="Options for connecting to git repository" width="746" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the repo of your site that you want to publish and then you'll get to this next screen. If you've kept things simple, then owner should be you and branch to deploy is probably "main". I have never needed to make any changes to the "Basic build Settings" section myself, but you can certainly go and learn more about it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4148tic6ucez7wik1rh3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4148tic6ucez7wik1rh3.png" alt="screenshot build options" width="643" height="830"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click "Deploy site" when you're ready and it will start the build / deploy process. If there are any errors, then they will be highlighted here, otherwise your site will be live! It's that easy!&lt;/p&gt;

&lt;p&gt;At this point, if you have a custom domain you've purchased, you can also add it via the "Domain Settings" option. I won't go into that now, but there is some helpful information for that on &lt;a href="https://docs.netlify.com/domains-https/custom-domains/#app" rel="noopener noreferrer"&gt;Netlify's docs&lt;/a&gt; and you can also ask your domain provider if you're not sure how to connect it to your site.&lt;/p&gt;

&lt;p&gt;There we are! I think that's a pretty straightforward option for even beginners looking to host their first site, but if you have any other recommendations / tips then please do share so everyone can learn! ☺️&lt;br&gt;
_&lt;br&gt;
Credit: Cover photo by &lt;a href="https://unsplash.com/@cookiethepom?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Cookie the Pom&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/dog-laptop?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;_&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>drupal</category>
    </item>
    <item>
      <title>How to use the Forem API to display your DEV.to blog posts on your website (easy!)</title>
      <dc:creator>Tia Eastwood</dc:creator>
      <pubDate>Sun, 13 Nov 2022 21:59:36 +0000</pubDate>
      <link>https://dev.to/tiaeastwood/how-to-use-the-forem-api-to-display-your-devto-blog-posts-on-your-website-easy-3dl3</link>
      <guid>https://dev.to/tiaeastwood/how-to-use-the-forem-api-to-display-your-devto-blog-posts-on-your-website-easy-3dl3</guid>
      <description>&lt;p&gt;In the past, I had blog websites (think Jekyll and Gatsby) where I would create and publish my blog posts, then I would cross-post them to DEV.to and other sites afterwards. &lt;/p&gt;

&lt;p&gt;But what if you want to do it the other way round, huh? Well it's actually super easy! There isn't even any kind of authentication needed. In this article I will explain how to use the &lt;a href="https://developers.forem.com/api/v1#tag/articles/operation/getArticles"&gt;Forem API&lt;/a&gt; to display your blog posts on your website. In this example, I will also be using &lt;strong&gt;React&lt;/strong&gt; and the &lt;strong&gt;fetch API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Firstly, go and have a look at the &lt;a href="https://developers.forem.com/api"&gt;docs for the Forem API&lt;/a&gt;, have a little read, and familiarise yourself a little bit. Then head to &lt;a href="https://developers.forem.com/api/v1"&gt;version 1 of the API&lt;/a&gt; to see the available endpoints.&lt;/p&gt;

&lt;p&gt;So I have a React app that will display blog posts. All I need to do to display my posts, is to make a fetch request to the &lt;a href="https://developers.forem.com/api/v1#tag/articles"&gt;articles endpoint&lt;/a&gt;, with my username as a parameter.&lt;/p&gt;

&lt;p&gt;I want to make the request as soon as the page loads, so I made a function called getPosts(), which makes the fetch request to the API endpoint and I have called this in the useEffect which runs once. To get your own posts, just insert your username into the url like so, or add it as a parameter:&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="c1"&gt;// replace {yourUserName} with your DEV.to username:&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://dev.to/api/articles?username={yourUserName}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my app it looks like this:&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="nx"&gt;useEffect&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="nx"&gt;getPosts&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getPosts&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;try&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;response&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://dev.to/api/articles?username=tiaeastwood&amp;amp;per_page=8&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;json&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;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nx"&gt;setPosts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&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;p&gt;I also added a query, so that it limits the result to 8 items at a time (per_page=8) and the API documentation will show you what other queries you can use.&lt;/p&gt;

&lt;p&gt;So once the fetch request has been successfully made, I use setPosts() to store the result of the fetch in state, so that I can access it in the render. This gives us an array of post objects, and I can access the different properties of each, such as the title, cover_image etc to dynamically display what I want to in my component; you can see that in PostThumbnail component:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PostThumbnail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;post&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;grid-item&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-overlay&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;gradient&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cover_image&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cover-image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setPosts&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;

  &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useEffect&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="nx"&gt;getPosts&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getPosts&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&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;response&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://dev.to/api/articles?username=tiaeastwood&amp;amp;per_page=8&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;json&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;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="nx"&gt;setPosts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&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="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Latest&lt;/span&gt; &lt;span class="nx"&gt;Blog&lt;/span&gt; &lt;span class="nx"&gt;Posts&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;grid&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;post&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;PostThumbnail&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="p"&gt;))}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&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="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;


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

&lt;/div&gt;



&lt;p&gt;When you make your fetch request, I recommend popping a console.log in somewhere, or having a look in the network tab of your browser devtools, so you can see all of the information you get about each blog post, it's quite a lot!&lt;/p&gt;

&lt;p&gt;Finally, here is the CodePen example, so you can see how the code all comes together :) &lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/tiaeastwood/embed/NWzgxYx?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;Credits:&lt;br&gt;
This post's cover image is by &lt;a href="https://unsplash.com/@krisdeschacals?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Christopher Machicoane-Hurtaud&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/amazed?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>tutorial</category>
      <category>react</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
