<?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: Mulligan81</title>
    <description>The latest articles on DEV Community by Mulligan81 (@mulligan81).</description>
    <link>https://dev.to/mulligan81</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%2F445828%2F0d23983f-3e6b-4d4e-ac75-4d27d9161c31.png</url>
      <title>DEV Community: Mulligan81</title>
      <link>https://dev.to/mulligan81</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mulligan81"/>
    <language>en</language>
    <item>
      <title>HTTPS protocol and data encryption</title>
      <dc:creator>Mulligan81</dc:creator>
      <pubDate>Sat, 10 Dec 2022 13:06:18 +0000</pubDate>
      <link>https://dev.to/mulligan81/https-protocol-and-data-encryption-j15</link>
      <guid>https://dev.to/mulligan81/https-protocol-and-data-encryption-j15</guid>
      <description>&lt;p&gt;It is known, that &lt;/p&gt;

&lt;p&gt;In HTTPS, the communication protocol is encrypted using Transport Layer Security (TLS) or, formerly, Secure Sockets Layer (SSL)&lt;/p&gt;

&lt;p&gt;My question is - having a simple &lt;code&gt;html&lt;/code&gt; login form hosted on the &lt;code&gt;HTTPS&lt;/code&gt; enabled server when the user enters the address starting &lt;code&gt;https://&lt;/code&gt; i'm i right that the browser automatically encrypts the login data (login and password) thus allowing for a secure communication (the browser sees the &lt;code&gt;HTTPS&lt;/code&gt; as a protocol and understands that the data send HAVE to be encrypted)?&lt;/p&gt;

&lt;p&gt;Thx for explanation.&lt;/p&gt;

</description>
      <category>https</category>
      <category>browser</category>
    </item>
    <item>
      <title>Login system and user credentials</title>
      <dc:creator>Mulligan81</dc:creator>
      <pubDate>Fri, 20 May 2022 14:25:14 +0000</pubDate>
      <link>https://dev.to/mulligan81/login-system-and-user-credentials-c2b</link>
      <guid>https://dev.to/mulligan81/login-system-and-user-credentials-c2b</guid>
      <description>&lt;p&gt;I'm building a &lt;code&gt;React&lt;/code&gt;app that requires users authentication (just to be logged in) to access some of the resources. I'd like to persist the user credentials with the &lt;code&gt;secure&lt;/code&gt;&amp;amp; &lt;code&gt;HttpOnly&lt;/code&gt;cookies. And there is my question: Is it a good idea to make the "is the user logged in" checking on client side (for e.g. by just by examining the document.cookie for login/password cookie) to speed up the app by not engaging the server site just to check if the cookies was set?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React useState unexpected extra render</title>
      <dc:creator>Mulligan81</dc:creator>
      <pubDate>Sun, 08 May 2022 10:14:16 +0000</pubDate>
      <link>https://dev.to/mulligan81/react-usestate-unexpected-extra-render-5eh1</link>
      <guid>https://dev.to/mulligan81/react-usestate-unexpected-extra-render-5eh1</guid>
      <description>&lt;p&gt;Taking this simple &lt;code&gt;React&lt;/code&gt; counter example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`const { useState } = React;

function Example() {
  // Declare a new state variable, which we'll call "count"
  const [count, setCount] = useState(0);

  console.log("Example")

  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(1)}&amp;gt;
        Click me
      &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

const rootElement = document.getElementById("root");
ReactDOM.render(&amp;lt;Example /&amp;gt;, rootElement);`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I've intentionally set the &lt;code&gt;setCount&lt;/code&gt; handler to just const value for experimental reasons. And there is something very strange to me - the App re-renders the second time when I click the button the second time! (I'm getting &lt;code&gt;Example&lt;/code&gt; output on the first and ALSO on the second click!) &lt;/p&gt;

&lt;p&gt;My BIG question is HOW can it happen if in the case of the second click the value of the &lt;code&gt;count&lt;/code&gt; variable HASN'T changed since the first click!? (by clicking the first time is set to just &lt;code&gt;1&lt;/code&gt; and the second time ALSO to &lt;code&gt;1&lt;/code&gt;!)&lt;/p&gt;

&lt;p&gt;When I click the third time and more it seems to work as expected - there are no further re-renders...&lt;/p&gt;

&lt;p&gt;Can someone please explain me the reason of this extra render after the second click?&lt;/p&gt;

&lt;p&gt;P.S.&lt;/p&gt;

&lt;p&gt;PLEASE don't tell me that the cause of this may be the &lt;code&gt;react strict mode&lt;/code&gt; - As anyone can CLEARLY see I'm NOT using the &lt;code&gt;strict mode&lt;/code&gt; anywhere!!!&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>Adding external javascript script to React</title>
      <dc:creator>Mulligan81</dc:creator>
      <pubDate>Tue, 11 Jan 2022 11:07:49 +0000</pubDate>
      <link>https://dev.to/mulligan81/adding-external-javascript-script-to-react-3a25</link>
      <guid>https://dev.to/mulligan81/adding-external-javascript-script-to-react-3a25</guid>
      <description>&lt;p&gt;I'd like to include &amp;amp; run some &lt;code&gt;js&lt;/code&gt; file in the &lt;code&gt;React&lt;/code&gt; using &lt;code&gt;Helmet&lt;/code&gt; component. Here is the simple code:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;index.js:&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import ReactDOM from "react-dom";
import { Helmet } from "react-helmet";

import "./styles.css";

function App() {
  console.log("op");

  return (
    &amp;lt;div className="App"&amp;gt;
      &amp;lt;Helmet&amp;gt;
        &amp;lt;script src="hello.js" type="text/jsx" /&amp;gt;
      &amp;lt;/Helmet&amp;gt;
      &amp;lt;h1&amp;gt;Hellok CodeSandbox&amp;lt;/h1&amp;gt;
      &amp;lt;h2&amp;gt;Start editing to see some magic happen!&amp;lt;/h2&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and ultra simple &lt;code&gt;js&lt;/code&gt; script to include &amp;amp; run:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;hello.js:&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("opl882...")
document.body.style.backgroundColor = "red";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;But the script seems NOT to work! - i have no console output and/or background color changed. What's odd when I use the &lt;code&gt;js&lt;/code&gt; code as an inline code like:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;Helmet&amp;gt;
   &amp;lt;script type="text/javascript"&amp;gt;
     console.log("opl882..."); document.body.style.backgroundColor = "red"
   &amp;lt;/script&amp;gt;
 &amp;lt;/Helmet&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;it works! &lt;/p&gt;

&lt;p&gt;Why doesn't  the external &lt;code&gt;js&lt;/code&gt; file work?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Adding `js` script to the React project.</title>
      <dc:creator>Mulligan81</dc:creator>
      <pubDate>Mon, 03 Aug 2020 08:04:59 +0000</pubDate>
      <link>https://dev.to/mulligan81/adding-js-script-to-the-react-project-4m8d</link>
      <guid>https://dev.to/mulligan81/adding-js-script-to-the-react-project-4m8d</guid>
      <description>&lt;p&gt;How can i add a simple, classic &lt;em&gt;js&lt;/em&gt; script to the react project? &lt;br&gt;
I've tried to add it just by adding&lt;br&gt;
    &lt;code&gt;&amp;lt;script src="../src/alert.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;br&gt;
in the &lt;em&gt;head&lt;/em&gt; of the &lt;em&gt;index.html&lt;/em&gt; but it seems not to work!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
