<?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: Nastassia Danilava</title>
    <description>The latest articles on Forem by Nastassia Danilava (@nastassia).</description>
    <link>https://forem.com/nastassia</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%2F329173%2F0f4f79d7-21ed-42f1-a4fc-e7ce4cb3c8a8.jpeg</url>
      <title>Forem: Nastassia Danilava</title>
      <link>https://forem.com/nastassia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nastassia"/>
    <language>en</language>
    <item>
      <title>Freelancing in 2024: expectations vs realities</title>
      <dc:creator>Nastassia Danilava</dc:creator>
      <pubDate>Tue, 23 Apr 2024 20:43:49 +0000</pubDate>
      <link>https://forem.com/nastassia/freelancing-in-2024-expectations-vs-realities-3n92</link>
      <guid>https://forem.com/nastassia/freelancing-in-2024-expectations-vs-realities-3n92</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Approximately a year and a half ago I was on maternity leave and decided to return to work. I was a developer with 7 years of experience. I wasn’t ready to work full time yet so I wanted to try myself as a freelancer. So I updated my CV, set the linkedIn status “Open for work” and started finding a job.&lt;br&gt;
The first weeks were crazy and I tried at least to be in the list of candidates who were selected for the interview. I passed through a lot of small calls and interviews and now I understand why it was difficult. It was my first experience where there are no managers or marketing specialists who can sell you or your skills or promote your resume. I had to learn how to sell myself. And &lt;strong&gt;sell&lt;/strong&gt; here is the most important word&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  1. Customer is...
&lt;/h2&gt;

&lt;p&gt;When considering selling services, it's crucial to identify who most frequently seeks out freelancers. Based on my experience, the primary seekers are:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frkbf5bdzu9k6hsbno59m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frkbf5bdzu9k6hsbno59m.png" alt="freelancers customers" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this, I’ve learned that there are two main pathways to develop a freelancing career: either acquire unique skills that are in rare supply or seek collaborations with small teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Sell yourself not as a person but as a service.
&lt;/h2&gt;

&lt;p&gt;Reflect your past experience not by places of employment but by projects. What do I mean by this. In most cases customers are looking for somebody who can create a ready-to-use business solution, so your CV should illustrate this. Compare:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Regular Work&lt;/th&gt;
&lt;th&gt;Freelance&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Company A (2020-2022)&lt;/strong&gt;:1.leaded fin project  2.introduced integration tests 3.followed agile methodology&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Project A (link)&lt;/strong&gt;:1. added the chatBot that amount of leads on 13% 2. added the users analytics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Company B (2022- Present)&lt;/strong&gt;: 1. passed the english test on B2 2. participated in interview process 3. used Vue.JS, React.JS stack on 3 different projects&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Project B (link)&lt;/strong&gt;: 1. developed the QR code scanner 2. implemented the landing page that supports most of the screen resolutions 3. organised the tech tasks board for the team of 3 other devs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Collect your achievements
&lt;/h3&gt;

&lt;p&gt;Keep a document where you detail interesting tasks that led to success, or any interesting situations: conflicts you managed to resolve, division of duties, managerial experience. &lt;/p&gt;

&lt;p&gt;Here's the structure of my document&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhdwjhx52xuqy0frwevq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhdwjhx52xuqy0frwevq.png" alt="the structure of self-reflection document" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's also very useful to note situations in which soft skills have been beneficial. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dealing with an unproductive teammate and the strategies used to improve the situation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Handling situations where overtime is typical and expected of you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Managing task underestimations effectively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strategies for dividing tasks within the team.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Responding to overly high expectations from the team.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And do it &lt;em&gt;during your work&lt;/em&gt;, as it’s impossible to revise what task you done 5 years ago.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;After I redone the CV several times and spent 2-3 months on freelancers platforms I figured out that the HRs wrote to me several times more often because I was very active on my social networks. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Regularly update your social networks
&lt;/h2&gt;

&lt;p&gt;Choose 2-3 platforms where you will be active and post updates about your projects, successes, and failures! Or just be yourself and talk about your day, what inspired or disappointed you today, and alternate with professional posts. Don't be afraid to show your failure: it's an indicator that you've analyzed the situation and will apply the experience to your work. &lt;br&gt;
*&lt;em&gt;Why? *&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It’s a eminding potential clients of your expertise and availability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increases your chances of being seen by potential clients outside your immediate network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sharing insights, trends, and commentary on industry-related topics positions you as a knowledgeable professional in your field.&lt;br&gt;
&lt;strong&gt;Be visible on every your career step&lt;/strong&gt;. Even if you think that the topic you’re going to write is discussed already and everybody knows. No. The way you do it better for someone.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;For the freelancer time is everything, I’m working 4 hours per day and that’s why I’m optimize everything  that I can that’s why ...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4. Use AI in your work
&lt;/h2&gt;

&lt;p&gt;It's foolish to deny it, but AI has firmly entered our lives and it's here to stay. So, why not apply these technologies? I believe that there are a huge amount of materials covered it but here's 3 things that I’m doing with the help of AI more often&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;troubleshooting&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ask to do boilerplates for the task. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;formatting&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Recent case&lt;br&gt;
I’m not a designer at all that's why I did screenshots of my product and told AI that I described the feature I need to implement. It gave me an advice where the better place to put a buttons, and the list of UI controls that it’s better to use&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  5. Money
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Initial period for the freelancer is super unstable and it took for me 3 months before I get acceptable income and 7 month before I was satisfied with project and salary&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Build a safety cushion for the initial period it’s an essential. Set your minimum acceptable salary and don’t decrease it even. But be ready to do a lot of test tasks for free at th beginning.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvozbg7g5varhmagd19f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvozbg7g5varhmagd19f.png" alt="poor developer" width="676" height="864"&gt;&lt;/a&gt;&lt;br&gt;
 When you get the project and salary - breathe out. You've already done it. Constantly thinking about how to raise your income is a path to burnout.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvy1g6qthae3hndeq1n50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvy1g6qthae3hndeq1n50.png" alt="rich developer" width="586" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Networking
&lt;/h2&gt;

&lt;p&gt;Networking and self-presentation skills are crucial, as you need to constantly pitch your skills and the outcomes of your work. Therefore, proficiency in speaking and presenting is essential.&lt;br&gt;
But how can you improve these skills? Through networking events, public speaking, and even creating videos on social media.&lt;br&gt;
&lt;em&gt;Don't be afraid to tell everyone that you're looking for a project.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I once challenged myself to go out for coffee with 5 strangers over a month. This meant I had to find 5 people at events or through social media, talk to them, and then meet them for coffee.&lt;br&gt;
Two years ago, this idea seemed crazy, but it proved to be an effective method. Speaking about yourself for the first time might be intimidating, but by the time you've talked about your projects or achievements for the 50th time, it becomes second nature.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7. Leverage project management tools and techniques.
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;When I decided to find a startup not a short-contract project I realised that I need to communicate even more. I wrote lot of cover letters, a lot of interviews.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Freelance and startup industry is a area where the team is not big. As a freelancer, you're not just a developer; you're also managing your projects. Knowledge of project management tools like trello, asana, notion, monday.com, jira , etc. can help you stay organised, meet deadlines, and communicate effectively with clients. Even if it seems to be unnecessary at one point it can be a benefit. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7wxe2gbumux8ngufwxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7wxe2gbumux8ngufwxv.png" alt="conclusion" width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>freelance</category>
      <category>career</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JavaScript Revelations: Journeying Through Frontend Interview Preparation (live-stream note)</title>
      <dc:creator>Nastassia Danilava</dc:creator>
      <pubDate>Wed, 13 Sep 2023 14:42:15 +0000</pubDate>
      <link>https://forem.com/nastassia/javascript-revelations-journeying-through-tech-interview-preparation-32gp</link>
      <guid>https://forem.com/nastassia/javascript-revelations-journeying-through-tech-interview-preparation-32gp</guid>
      <description>&lt;p&gt;It's not my first job as a frontend developer, but I prepare for EVERY interview because some things have changed, some I need to revise, and some I have never known before.&lt;/p&gt;

&lt;p&gt;I'm going to write a list of small JavaScript notes that I learned (or found interesting) during the preparation this time. This is a live-stream note, so bookmark this! 😏&lt;/p&gt;

&lt;h2&gt;
  
  
  Javascript
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. ForEach loop cant be stopped by &lt;code&gt;return&lt;/code&gt; or &lt;code&gt;break&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Consider the following code snippet. Would you expect it to print '1', '2', and then halt?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = ['a', 'b', 'c'];
array.forEach(function (element) {
  console.log(element);

  if (element === 'b') 
    return;

});
// Output: 1 2 3 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Surprisingly, it doesn't. And the same with &lt;code&gt;break&lt;/code&gt;&lt;br&gt;
&lt;em&gt;If there is a case when you definately need to stop it use &lt;code&gt;for&lt;/code&gt; instead of &lt;code&gt;forEach&lt;/code&gt; and &lt;code&gt;break&lt;/code&gt; inside it&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;or with throwing the exception and wrapping the loop with &lt;code&gt;try-catch&lt;/code&gt; - thanks &lt;a class="mentioned-user" href="https://dev.to/szalonna"&gt;@szalonna&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The &lt;code&gt;__proto__&lt;/code&gt; references can’t go in circles.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thanks god JavaScript will throw an error if we try to assign and there is no need to care with any try-catch 🙃&lt;/p&gt;

&lt;p&gt;&lt;code&gt;M715:1 Uncaught TypeError: Cyclic __proto__ value&lt;br&gt;
    at set __proto__ [as __proto__] (&amp;lt;anonymous&amp;gt;)&lt;br&gt;
    at &amp;lt;anonymous&amp;gt;:1:13&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The most clear Prototyping inheritance &lt;a href="https://javascript.info/prototype-inheritance"&gt;description&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. logical assignment was added in ES2021&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;a &amp;amp;&amp;amp;= b&lt;/code&gt; // equivalent to a &amp;amp;&amp;amp; (a = b). will assign if a is &lt;code&gt;false&lt;/code&gt;&lt;br&gt;
&lt;code&gt;a ||=b&lt;/code&gt; // equvalent to a || (a = b). will assign if a is &lt;code&gt;false&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Web
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Web security issues (XSS, XSRF). This &lt;em&gt;could be&lt;/em&gt; included to the interview, but most you need to know as a FE dev is&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;XSS&lt;/strong&gt; - when an application includes untrusted data in a web page sent to the browser without proper validation or escaping. Attackers can inject malicious scripts into web pages.&lt;br&gt;
how to prevent&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input Validation and Sanitization: Ensure that user input is validated before rendering it on the web page. Use security libraries or frameworks that offer built-in protection against XSS.&lt;/li&gt;
&lt;li&gt;Content Security Policy (CSP): Implement a CSP that restricts the sources from which scripts can be loaded, preventing unauthorized scripts from executing.&lt;/li&gt;
&lt;li&gt;Escape User-Generated Content: Escape any user-generated content when rendering it on the page. This involves converting special characters to their HTML entity equivalents.&lt;/li&gt;
&lt;li&gt;Use HTTP-Only Cookies: Store session cookies with the HttpOnly attribute, which prevents JavaScript from accessing them. This helps protect against cookie theft via XSS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;CSRF&lt;/strong&gt; - attacker tricks a user into performing actions on a website without the user's knowledge or consent. The attacker crafts malicious requests that are executed using the user's authenticated session.&lt;br&gt;
how to prevent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Anti-CSRF Tokens: Generate unique tokens for each user session and include them in forms or AJAX requests. Verify these tokens on the server side to ensure that requests are legitimate.&lt;/li&gt;
&lt;li&gt;Same-Site Cookies: Set the SameSite attribute on cookies to restrict when cookies are sent in cross-origin requests, reducing the risk of CSRF attacks.&lt;/li&gt;
&lt;li&gt;Check Referer Header: Verify the Referer or Origin headers on incoming requests to ensure that they match the expected source of the request.&lt;/li&gt;
&lt;li&gt;Implement Safe HTTP Methods like GET for actions that should not modify data. Reserve POST, PUT, DELETE, etc., for actions that make changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;..to be continued&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>interview</category>
      <category>frontend</category>
      <category>datastructures</category>
    </item>
    <item>
      <title>Boo! Pure CSS Halloween card 🎃</title>
      <dc:creator>Nastassia Danilava</dc:creator>
      <pubDate>Fri, 30 Oct 2020 13:57:12 +0000</pubDate>
      <link>https://forem.com/nastassia/boo-pure-css-240p</link>
      <guid>https://forem.com/nastassia/boo-pure-css-240p</guid>
      <description>&lt;p&gt;It's Halloween eve now and here's my pure HTML&amp;amp;CSS card on GitHub profile README.md&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4ydpg4tcujh4g1cjz0p2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4ydpg4tcujh4g1cjz0p2.png" alt="GitHub Profile README.md" width="744" height="616"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to insert full HTML to markdown?
&lt;/h2&gt;

&lt;p&gt;use foreignObject in SVG&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;svg fill="none" viewBox="0 0 400 400" width="400" height="300" xmlns="http://www.w3.org/2000/svg"&amp;gt;
  &amp;lt;foreignObject width="100%" height="100%"&amp;gt;
    &amp;lt;div xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
      &amp;lt;style&amp;gt;
      .cat {
        position: relative;
        padding-left: 50px;
        height: 300px;
        width: 300px;
      }
     &amp;lt;/style&amp;gt;
     &amp;lt;div class="cat" /&amp;gt;
   &amp;lt;/div&amp;gt;
  &amp;lt;/foreignObject&amp;gt;
&amp;lt;/svg&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;use SVG file in markdown as usual image&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![](./halloween.svg)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/nastassiadanilova"&gt;live demo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>github</category>
      <category>html</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Add commit hash version to your React app</title>
      <dc:creator>Nastassia Danilava</dc:creator>
      <pubDate>Tue, 07 Jul 2020 15:30:00 +0000</pubDate>
      <link>https://forem.com/nastassia/add-commit-hash-version-to-your-react-app-n3n</link>
      <guid>https://forem.com/nastassia/add-commit-hash-version-to-your-react-app-n3n</guid>
      <description>&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;Check the current build version to be sure that everything is up-to-date. Ideally in some unnoticeable for user place on the page (if you have any reasons not to use console in this case). &lt;/p&gt;

&lt;h2&gt;
  
  
  Solution (Step-by-step)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Get the last git commit hash from the command line&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;git rev-parse --short HEAD&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Execute the script above with Node.js. The best option to do this is with Node.js child_process. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;child_process.execSync(git rev-parse --short HEAD)&lt;/code&gt;&lt;br&gt;
The only thing you should know here is that &lt;code&gt;execSync&lt;/code&gt; allows you to execute the command &lt;a href="https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options"&gt;synchronously&lt;/a&gt;. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an environment variable that contains a necessary hash. By default, your variable should be starting with REACT_APP_. In other cases, it would be ignored. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are several ways to do it actually. The first one is to replace your standard start and build project commands in &lt;code&gt;package.json&lt;/code&gt; with this one&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"start": "export REACT_APP_VERSION=$(git rev-parse HEAD) &amp;amp;&amp;amp; react-scripts start",&lt;br&gt;
"build": "export REACT_APP_VERSION=$(git rev-parse HEAD) &amp;amp;&amp;amp; react-scripts build"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;or just insert this line to your &lt;code&gt;webpack.config.js&lt;/code&gt;&lt;br&gt;
&lt;code&gt;const commitHash = require('child_process').execSync('git rev-parse --short HEAD')&lt;/code&gt;&lt;br&gt;
Calculated commit hash should be wrapped with &lt;code&gt;DefinePlugin&lt;/code&gt; function in plugins array.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;new webpack.DefinePlugin({&lt;br&gt;
    'COMMIT_HASH': JSON.stringify(commitHash),&lt;br&gt;
 })&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;That's all. Now your hash is available in the React app code &lt;code&gt;process.env.REACT_APP_VERSION&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: the environment variables are embedded during the build time. Since Create React App produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime. To read them at runtime, you would need to load HTML into memory on the server and replace placeholders in runtime, as described here. Alternatively, you can rebuild the app on the server anytime you change them. &lt;a href="https://create-react-app.dev/docs/adding-custom-environment-variables/"&gt;Create React App docs&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;It's better to store the value of such variables in any global store like Redux or just as a global variable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;window.VERSION = process.env.REACT_APP_VERSION&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;Happy Codding ⌨️! ❤️&lt;/p&gt;

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