<?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: Geoffrey D Brophy</title>
    <description>The latest articles on DEV Community by Geoffrey D Brophy (@yesiamanerd).</description>
    <link>https://dev.to/yesiamanerd</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%2F1197442%2F44fde511-6f67-43a1-9eb6-308a823566fa.png</url>
      <title>DEV Community: Geoffrey D Brophy</title>
      <link>https://dev.to/yesiamanerd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yesiamanerd"/>
    <language>en</language>
    <item>
      <title>My first React JS work</title>
      <dc:creator>Geoffrey D Brophy</dc:creator>
      <pubDate>Mon, 30 Oct 2023 15:33:07 +0000</pubDate>
      <link>https://dev.to/yesiamanerd/my-first-react-js-work-5en5</link>
      <guid>https://dev.to/yesiamanerd/my-first-react-js-work-5en5</guid>
      <description>&lt;p&gt;This the first project that created by following allow with the instructor:&lt;/p&gt;

&lt;p&gt;index.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { StrictMode } from "react";
import { createRoot } from "react-dom/client";

import App from "./App";

const rootElement = document.getElementById("root");
const root = createRoot(rootElement);

root.render(
  &amp;lt;StrictMode&amp;gt;
    &amp;lt;App /&amp;gt;
  &amp;lt;/StrictMode&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;App.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useEffect, useState } from "react"


export default function App(){
  const [advice, setAdvice] = useState("");
  const [count, setCount] = useState(0);

  async function getAdvice(){
     const res = await fetch('https://api.adviceslip.com/advice');
     const data = await res.json();
     setAdvice(data.slip.advice);
     setCount((c) =&amp;gt; c + 1);

  }

  useEffect(function () {
    getAdvice();
  }, []);

  return ( 
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;{ advice }&amp;lt;/h1&amp;gt;
      &amp;lt;button onClick={getAdvice}&amp;gt;Get Advice &amp;lt;/button&amp;gt;
      &amp;lt;Message count={count}/&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

function Message(props){
  return (
    &amp;lt;p&amp;gt;
      You have read &amp;lt;strong&amp;gt;{props.count}&amp;lt;/strong&amp;gt; pieces of advice
    &amp;lt;/p&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>react</category>
    </item>
  </channel>
</rss>
