<?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>Forem: Jocke Sjölin</title>
    <description>The latest articles on Forem by Jocke Sjölin (@jocke_sjlin_4ca0d80beae0).</description>
    <link>https://forem.com/jocke_sjlin_4ca0d80beae0</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%2F3444630%2Fda4128eb-a82b-4285-8e00-37d3037bd788.png</url>
      <title>Forem: Jocke Sjölin</title>
      <link>https://forem.com/jocke_sjlin_4ca0d80beae0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jocke_sjlin_4ca0d80beae0"/>
    <language>en</language>
    <item>
      <title>The Power Platform – An Introduction for Beginners</title>
      <dc:creator>Jocke Sjölin</dc:creator>
      <pubDate>Sun, 05 Oct 2025 12:59:49 +0000</pubDate>
      <link>https://forem.com/jocke_sjlin_4ca0d80beae0/the-power-platform-an-introduction-for-beginners-4d6o</link>
      <guid>https://forem.com/jocke_sjlin_4ca0d80beae0/the-power-platform-an-introduction-for-beginners-4d6o</guid>
      <description>&lt;p&gt;Many businesses take a chaotic approach to managing daily operations: a mixture of spreadsheets, apps and manual tasks. What if instead there was an all-encompassing suite of tools out there for taking care of most of your business needs? The good news is that there is in fact something like that, and it's called the Microsoft Power Platform.&lt;/p&gt;

&lt;p&gt;It lets you automate, analyze and build custom solutions for your business without writing a single line of code. It's far from a fringe-product, instead you'll be joining the majority of Fortune 500 companies in using a highly developed and widely supported platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Power Platform and what are its benefits?
&lt;/h2&gt;

&lt;p&gt;The Microsoft Power Platform is a collection of low-code tools and products that each serve a specific purpose, such as analyzing and presenting data, building custom business apps and websites, setting up automated workflows, and even designing AI-powered chatbots.&lt;/p&gt;

&lt;p&gt;The Power Platform was created with non-technical as much as technical users in mind, and it aims to be useful even to people who don’t “know how to code” in the traditional sense. This can act as a great equalizer in many organizations, allowing non-developers (those involved in specific processes, such as field technicians) to directly implement their own solutions, rather than rely on the interpretation of specialized developers to be accurate. Cutting out the middleman, so to speak. After all, most people tend to know best that which they do every day.&lt;/p&gt;

&lt;p&gt;The Power Platform is not an isolated system, but is instead an integral part of the wider Microsoft ecosystem, offering full integration with Teams, Dynamics 365, and Azure among others. Power Platform products can also be connected to several third-party services like GitHub, Slack, and Salesforce.&lt;/p&gt;

&lt;p&gt;The Power Platform is not completely devoid of code, however. Instead it relies on Microsoft’s low-code programming language, Power Fx, to express logic. But don’t worry, Power Fx is still much easier to both learn and understand compared to traditional programming languages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Products in the Power Platform
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Power BI:&lt;/strong&gt; All about analyzing and visualizing data using charts, graphs, dashboards and more. This process can help generate insights that support better business decisions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Power Apps:&lt;/strong&gt; Create custom business apps using low-code tools. Web and mobile apps that solve specific problems can often be put together quickly by simply combining the right ready-made components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Power Pages:&lt;/strong&gt; Similar to Power Apps, but the end result is custom, data-driven business websites. These tend to be external-facing (customer portals, partner hubs, etc.) compared to the more internal-facing nature of Power Apps.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Power Automate:&lt;/strong&gt; A tool focused on processes and interactions between services — both Microsoft-owned and third-party. Perfect for automating repetitive tasks like sending an email to the right department after an invoice is paid.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Copilot Studio:&lt;/strong&gt; (formerly Power Virtual Agents): low-code platform for building custom AI chatbots and copilots (agents) that can be connected with Dataverse, external APIs and Microsoft 365 apps.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, these products make up a powerful (no pun intended) toolbox for solving a wide array of business problems or just vastly improving processes that are already in place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dataverse: one Database to Connect them all
&lt;/h2&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%2Fn6oc7nsy5d1s0wsufp3i.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%2Fn6oc7nsy5d1s0wsufp3i.png" alt="Power Platform Diagram" width="428" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dataverse is arguably the most important part of Power Platform, but its role is more of a supportive one for the other services in the suite rather than a standalone product. It's a relational database engine designed to be shared and connected not just to other Microsoft platforms but to external ones as well. Here you can store important business data like customer, product and sales records or any custom data your business needs to record.&lt;/p&gt;

&lt;p&gt;This data is stored in tables which can then be accessed by the other Power Platform services: Power Apps, Power Automate, Power Bi and Power Pages. Of course, every solution you design using these tools probably don't need access to all the data in your Dataverse - you can choose which tables to work with and ignore the rest. As a part of the Power Platform, Dataverse runs on Azure behind the scenes.&lt;/p&gt;

</description>
      <category>powerplatform</category>
      <category>lowcode</category>
      <category>powerapps</category>
      <category>automation</category>
    </item>
    <item>
      <title>The DOM Explained: Where Markup Meets JavaScript</title>
      <dc:creator>Jocke Sjölin</dc:creator>
      <pubDate>Thu, 04 Sep 2025 07:03:01 +0000</pubDate>
      <link>https://forem.com/jocke_sjlin_4ca0d80beae0/the-dom-explained-where-markup-meets-javascript-3ohc</link>
      <guid>https://forem.com/jocke_sjlin_4ca0d80beae0/the-dom-explained-where-markup-meets-javascript-3ohc</guid>
      <description>&lt;p&gt;If you're a web developer, chances are you've at least heard of the &lt;strong&gt;DOM - Document Object Model&lt;/strong&gt;. It might, however, be nothing more than an abstract concept at the back of your mind, yearning for clarification. That is what this article is hoping to achieve. So, on to the burning question: what exactly is the Document Object Model?&lt;/p&gt;

&lt;p&gt;Well, at the highest level and as the name implies it's a way of representing a document (usually HTML or XML) as a model consisting of objects (also called nodes). The nodes are organized in a hierarchical tree structure, with the document itself at the root, followed by the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; element which is in turn followed by top-level elements such as &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But, elements can also have inner text and attributes like &lt;code&gt;src&lt;/code&gt; and &lt;code&gt;href&lt;/code&gt;. These are also represented as nodes belonging to their respective parent elements.&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%2Fblpueav2cxcer19sfv8d.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%2Fblpueav2cxcer19sfv8d.png" alt="The DOM tree" width="501" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The 5 types of nodes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Document&lt;/strong&gt;: the root of the DOM tree that represents the web page as a whole. Corresponds to the &lt;code&gt;document&lt;/code&gt; object in JavaScript.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Element&lt;/strong&gt;: represents the HTML elements such as &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; that make up the building blocks of the page. Corresponds to their respective element names in JavaScript but are often manipulated using their &lt;code&gt;id&lt;/code&gt; or &lt;code&gt;class&lt;/code&gt; attributes.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Text&lt;/strong&gt;: represents text inside elements, such as &lt;code&gt;&amp;lt;p&amp;gt;Hello&amp;lt;/p&amp;gt;&lt;/code&gt;, where "Hello" is a text node belonging to the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; element node. Text nodes are always leaf nodes, meaning they have no child nodes / attributes of their own. Can be accessed using &lt;code&gt;element.innerText&lt;/code&gt; in JavaScript.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Attribute&lt;/strong&gt;: represents attributes of elements (like aforementioned &lt;code&gt;class&lt;/code&gt; and &lt;code&gt;id&lt;/code&gt;). Are usually accessed as properties of elements (&lt;code&gt;element.href&lt;/code&gt; for example) rather than as direct nodes.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Comment&lt;/strong&gt;: represents HTML comments (&lt;code&gt;&amp;lt;!-- like so --&amp;gt;&lt;/code&gt;) that are not visible on the page but still part of the DOM tree. There is rarely a need to access these through JavaScript.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The purpose of the DOM
&lt;/h2&gt;

&lt;p&gt;So, with what the DOM is and the different types of nodes out of the way, let's move on to the topic of what the DOM actually is used for. Its main function is to act as a sort of bridge or interface between the page content (HTML, CSS) and programming languages (most commonly JavaScript), allowing the programming language to manipulate the nodes in the DOM.&lt;/p&gt;

&lt;p&gt;These changes are then reflected in the HTML when the page is re-rendered by the browser. This allows for content to be changed dynamically, such as adding items to a list or clicking a button to change the background color of an element. &lt;/p&gt;

&lt;p&gt;Without this mechanism in place all content would have to be loaded statically from the server, with all "dynamic" updates being communicated through form submissions or similar, only then for everything to be fully re-rendered by the server.&lt;/p&gt;

&lt;p&gt;This is pretty much how the web worked in its infancy, with the DOM since then having become one of the most major foundations of the modern web.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-world examples of manipulating the DOM
&lt;/h2&gt;

&lt;p&gt;The main way developers interact with the DOM is with a programming language, usually JavaScript. This is done using the document object, which represents the whole web page in JavaScript (the document object is itself part of the window object which represents the browser's window). The document object allows us to access JavaScript's DOM methods for adding, removing and modifying existing nodes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modifying an element
&lt;/h3&gt;

&lt;p&gt;To modify an element, we first have to find it, something which is most easily done using &lt;code&gt;document.getElementById(id)&lt;/code&gt;, a method that finds a single element using its id attribute. We can also find collections of elements using &lt;code&gt;document.getElementsByClassName("&amp;lt;class&amp;gt;")&lt;/code&gt; or &lt;code&gt;document.getElementsByTagName("&amp;lt;tag&amp;gt;")&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These methods return HTMLCollection objects, which are array-like lists of elements that will have to be looped through in some way in order to be modified. Another perhaps more straightforward approach is using the newer &lt;strong&gt;querySelector&lt;/strong&gt; method, which returns the &lt;strong&gt;first&lt;/strong&gt; element that matches a specific query (CSS selector):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const linkElement = document.querySelector("#linkElement");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This makes it possible to use the same method regardless if we're matching by id, tag name or class name. As mentioned this method only returns the first match, while a related method, &lt;code&gt;document.querySelectorAll(".class")&lt;/code&gt;, returns all matches.&lt;/p&gt;

&lt;p&gt;Regardless of method used, once we have an element identified, we are now able to change its inner content, attributes and style properties. Here are some examples of modifying an already existing element in the DOM tree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const linkElement = document.querySelector(#linkElement);

linkElement.innerText = "Now my text is updated.";

linkElement.innerHTML = "&amp;lt;p&amp;gt;Now my innerHTML consists of a paragraph element with text.&amp;lt;/p&amp;gt;";

linkElement.href = "Now I'm pointing at a new destination!";

linkElement.style.backgroundColor = "red"; // Now my background color is red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating an element
&lt;/h3&gt;

&lt;p&gt;To create a new element we use the following method: &lt;code&gt;document.createElement("element")&lt;/code&gt;. This method takes as an argument the type of element to create, such as &lt;strong&gt;h1&lt;/strong&gt;, &lt;strong&gt;p&lt;/strong&gt;, or &lt;strong&gt;div&lt;/strong&gt;. However, simply creating the element is not enough, it's also necessary to define its location in the DOM tree.&lt;/p&gt;

&lt;p&gt;Before this step, the element still exists in memory and can be manipulated like other elements, but it's not part of the DOM. To fix this and make it visible to the user, we have to append it to an already existing element. For example, if we have an unordered list, &lt;code&gt;&amp;lt;ui&amp;gt;&lt;/code&gt;, we can create list items, &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; programmatically and append them to the &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Select the unordered list element
const ul = document.querySelector(\#list); 

// Create a list item element
const li1 = document.createElement("li");  

// Set the innerText of the list item element
li1.innerText = "I'm a list item"; 

// Append the list item element to the unordered list
ul.appendChild(li1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it's more of a stand-alone element, however, the created element can simply be appended to the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; element. It's also possible to append "invisible" elements like &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; to the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; elements, but it's not recommended to append directly to the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; element, since this is supposed to only have &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; elements as its children.&lt;/p&gt;

&lt;h3&gt;
  
  
  Removing an element
&lt;/h3&gt;

&lt;p&gt;Just like when modifying an element, removing an element also requires first retrieving it in the DOM. This is done in the same way, either using &lt;code&gt;document.getElementById&lt;/code&gt; or by using &lt;code&gt;querySelector&lt;/code&gt;. Once the element has been found, running &lt;code&gt;element.remove&lt;/code&gt; takes care of the rest.&lt;/p&gt;

&lt;p&gt;To remove multiple elements at once, such as those sharing the same class, the elements have to be retrieved as a HTMLCollection or NodeList and looped through, running the remove function on each item:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const items = document.querySelectorAll(".remove-me");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;items.forEach(item =&amp;gt; item.remove());&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It's also possible to set the innerHTML attribute of an element to an empty string, but this will remove everything inside the element:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const container = document.getElementById("demo");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;container.innerHTML = ""; // clears all child elements&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In a similar fashion, &lt;code&gt;replaceChildren()&lt;/code&gt; can also be used to clear the contents of an element (by simply replacing its children with nothing):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const container = document.getElementById("demo");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;container.replaceChildren(); // removes all children&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to skip the heavy lifting
&lt;/h3&gt;

&lt;p&gt;In addition to the methods of interacting with the DOM using vanilla JavaScript presented in this section, there are also many other libraries and frameworks that have more convenient, built-in ways of accomplishing the same things.&lt;/p&gt;

&lt;p&gt;One example is jQuery, which was created to simplify DOM manipulation across browsers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Select elements and change text
$(".item").text("Updated text");

// Add a new element
$("#list").append("&amp;lt;li&amp;gt;New item&amp;lt;/li&amp;gt;");

// Hide elements with animation
$(".alert").fadeOut();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another is React, which does not directly manipulate the DOM but instead uses a virtual DOM in order to only update the real DOM where new changes have been detected.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function App() {

  const [count, setCount] = React.useState(0);

  return (
    &amp;lt;div&amp;gt;

      &amp;lt;p&amp;gt;You clicked {count} times&amp;lt;/p&amp;gt;

      &amp;lt;button onClick={() =&amp;gt; setCount(count + 1)}&amp;gt;Click me&amp;lt;/button&amp;gt;

    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the p element is the only component that is re-rendered when the count state changes (when the button is clicked).&lt;/p&gt;

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

&lt;p&gt;To wrap things up, we've learned about the tree structure of the DOM, the 5 different types of nodes, why the DOM exists in the first place, how to modify, create and remove nodes in the DOM and finally how frameworks and libraries can simplify interacting with the DOM, making our developer lives a little easier. Happy coding and try to avoid DOMscrolling!&lt;/p&gt;

</description>
      <category>dom</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>React + Vite Setup Guide (Quickstart)</title>
      <dc:creator>Jocke Sjölin</dc:creator>
      <pubDate>Sun, 24 Aug 2025 05:11:37 +0000</pubDate>
      <link>https://forem.com/jocke_sjlin_4ca0d80beae0/3-step-process-to-spin-up-a-react-app-in-minutes-with-vite-1l26</link>
      <guid>https://forem.com/jocke_sjlin_4ca0d80beae0/3-step-process-to-spin-up-a-react-app-in-minutes-with-vite-1l26</guid>
      <description>&lt;p&gt;When a build tool is named after the French word for "fast" (not the hunger-related kind), you can assume it's designed for one thing and one thing only: deploying projects as quickly and efficiently as possible. This is exactly what Vite is about, and it can be used not just with React but with other frameworks and tools like Vue, Svelte and even plain old vanilla JavaScript.&lt;/p&gt;

&lt;p&gt;It works by running a super-fast development server using native ES modules in the browser, which means no heavy bundling during development and changes being reflected almost instantly. When it's time to put that sweet code into production, Vite uses &lt;strong&gt;Rollup&lt;/strong&gt; to bundle and optimize it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create Your Vite + React Project
&lt;/h2&gt;

&lt;p&gt;To create a new React project using Vite, the easiest way is to use the command line. Simply go to the folder where you want the project to be located and run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm create vite@latest my-react-app -- --template react&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This creates the boilerplate code and basic structure for your React project, such as the public and src folders, README and configuration files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Install the Right Dependencies
&lt;/h2&gt;

&lt;p&gt;Creating a new project only creates a list of dependencies and packages the project uses (in &lt;strong&gt;package.json&lt;/strong&gt;), it doesn't actually install them. For this crucial step to occur, you need to navigate to the folder of your newly created project:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd my-react-app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will install all the dependencies, sub-dependencies and packages required for the project to work (as listed in package.json) into the &lt;strong&gt;node_modules&lt;/strong&gt; folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Run the Dev Server 🚦
&lt;/h2&gt;

&lt;p&gt;With the foundation firmly in place, you're probably eager to see the React app in action and perhaps make some changes of your own. I hear you, and doing this simply required getting the development server up and running with the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Give it a few seconds, and the server should now be listening on &lt;a href="http://localhost:5173/" rel="noopener noreferrer"&gt;http://localhost:5173/&lt;/a&gt; (default as of this writing). Going to this address in the browser takes you to the "front page" of your project, which at this point mostly consists of the animated logos for Vite and React, as well as a clickable button demonstrating how to use &lt;strong&gt;state&lt;/strong&gt; by incrementing its value with every click.&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%2Fgep5r4dbrfaivkp9o4v8.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%2Fgep5r4dbrfaivkp9o4v8.png" alt="Vite + React starting page" width="411" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Explore &amp;amp; Tweak Your Project Files
&lt;/h2&gt;

&lt;p&gt;But you now have the power to change this and build something more interesting! To get started, open the project in VS Code or another IDE and start inspecting the project structure. The starter template is located in &lt;strong&gt;src/App.jsx&lt;/strong&gt; and this is where you can make changes that are in most cases reflected on the website as soon as you change the code and save.&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%2F8um1f0t9vrjhiif2mwps.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%2F8um1f0t9vrjhiif2mwps.png" alt="App.jsx code excerpt" width="800" height="648"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A simple yet predictable way is to add your own name to a &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag, but you can probably come up with something more interesting than that! You at least now have a good starting point for building your very own React app. Another suggested approach is to go do some beginner tutorials (perhaps over at &lt;strong&gt;freeCodeCamp&lt;/strong&gt; or &lt;strong&gt;W3Schools&lt;/strong&gt;), then add the different components you build there to this project. &lt;/p&gt;

&lt;p&gt;That gives you the opportunity to both have a library of components that you can edit as much as you want, and learn more about how everything interacts with each other. And finally, if you ever need a break from Vite and React (unlikely but possible) or just want to free up some RAM, &lt;strong&gt;Ctrl + C&lt;/strong&gt; stops the server as easily as &lt;strong&gt;npm run dev&lt;/strong&gt; starts it.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>react</category>
      <category>vite</category>
    </item>
    <item>
      <title>How to build a mobile weather app in React Native (part 1)</title>
      <dc:creator>Jocke Sjölin</dc:creator>
      <pubDate>Tue, 19 Aug 2025 08:36:43 +0000</pubDate>
      <link>https://forem.com/jocke_sjlin_4ca0d80beae0/how-to-build-a-mobile-weather-app-in-react-native-part-1-5cdb</link>
      <guid>https://forem.com/jocke_sjlin_4ca0d80beae0/how-to-build-a-mobile-weather-app-in-react-native-part-1-5cdb</guid>
      <description>&lt;p&gt;Building a mobile app can be hard, especially without much prior experience. First you have to come up with an idea that fulfills certain criteria:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is neither too easy nor too hard to make it worthwhile given your current skills.&lt;/li&gt;
&lt;li&gt;Is "fun" to work on: the idea should ideally solve a problem or improve your life in a personal area of interest.&lt;/li&gt;
&lt;li&gt;Is (somewhat) original: it doesn't have to be completely unique but should at least provide some new twist or perspective to an existing concept.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to these things, there are also technical considerations to take into account. As of 2025, some of these are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do I build a fully native app (Swift for iOS, Kotlin for Android)?&lt;/li&gt;
&lt;li&gt;Do I use a cross-platform framework like React Native, Flutter or Xamarin?&lt;/li&gt;
&lt;li&gt;Do I simply vibe code the whole thing using one of the many AI tools out there?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My motivation and how I picked a tech stack
&lt;/h2&gt;

&lt;p&gt;I know, I know, a weather app is just as cliche and unoriginal as a to-do list or calculator when getting familiar with a new programming language or tech stack. But there was one thing that had always bothered me with most weather apps - the clutter. For the most part when I'm checking the weather on my phone I only care about how it will change in the course of the day at my current location.&lt;/p&gt;

&lt;p&gt;I don't need an overload of data points and graphs for the next several weeks in order to make an informed decision about how to get dressed in the morning. So, I decided that the focus of my weather app was going to be simplicity, specifically to present the user with the current day's weather forecast for their current location.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sketching out the user interface
&lt;/h2&gt;

&lt;p&gt;To realize my "vision", I started by broadly sketching out the user interface. The original plan was to display each of the 24 hours in a day using a card, in the following way:&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%2Fpix3ywr8p312oyv2f7ox.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%2Fpix3ywr8p312oyv2f7ox.png" alt=" " width="313" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, each card displays the hour along with the weather conditions and temperature. When the user starts or refreshes the app, the current hour is highlighted in a contrasting color to the rest of the cards, and the view scrolls to keep the current hour in focus.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting with mock data
&lt;/h2&gt;

&lt;p&gt;To see my UI in action, I decided to build out a basic version using mock data. The long-term plan was of course to fetch live data from a weather API, but I wanted to have something tangible up and running before then. The mock data consisted of any array of objects following the same format as outlined above.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{ hour: '05:00', temperature: 10, weather: 'Cloudy' }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;With the mock data firmly in place, it was easy to set up the UI using a ScrollView:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;ScrollView ref={scrollViewRef} contentContainerStyle={styles.innerScrollView}&amp;gt;&lt;br&gt;
   &amp;lt;View style={styles.weatherContainer}&amp;gt;&lt;br&gt;
       {loading ? (&lt;br&gt;
           &amp;lt;View style={styles.loadingContainer}&amp;gt;&lt;br&gt;
               &amp;lt;ActivityIndicator size="large" color="#F5D547" /&amp;gt;&lt;br&gt;
           &amp;lt;/View&amp;gt;&lt;br&gt;
       ) : (&lt;br&gt;
           forecast.map((weatherGroup: {startHour: string, endHour:   string, weather: string, minTemp: string, maxTemp: string, icon: string}, index: number) =&amp;gt; (&lt;br&gt;
               createWeatherCard(weatherGroup, index)&lt;br&gt;
           ))&lt;br&gt;
       )}&lt;br&gt;
    &amp;lt;/View&amp;gt;&lt;br&gt;
&amp;lt;/ScrollView&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Merging the weather data and modifying the UI
&lt;/h2&gt;

&lt;p&gt;The end result looked OK, but it still felt a little cluttered: there were simply too many weather cards presented to the user at any one time. To remedy this, I decided to merge weather cards if they met all of the following conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adjacent hours (00:00 and 01:00, 17:00 and 18:00 etc)&lt;/li&gt;
&lt;li&gt;Temperature difference (no more or less than 5 degrees difference from the lowest and highest temperature of the current group. For example, a temperature of 15*C and 21*C would result in two separate groups, but not 15*C and 20*C.&lt;/li&gt;
&lt;li&gt;The same weather type (clear, cloudy, sunny etc)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This process significantly cut down the number of weather cards displayed on the screen, unless each hour has its own unique weather type (which is very rare).&lt;/p&gt;

&lt;p&gt;The updated UI now looks like this:&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%2Feagb0lfppaot2ouly0si.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%2Feagb0lfppaot2ouly0si.png" alt=" " width="322" height="716"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We now have a basic yet functional weather app, with one major issue: the weather data is hardcoded into the index.tsx file, meaning it always stays the same and making the app essentially useless apart from admiring the pretty UI. That is why the next part in this mini-series will cover how to fetch weather data from an API, handling an API key and dealing with the fetched data asynchronously.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>expo</category>
      <category>weather</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
