<?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: Ghaleb Al-Nakhlani</title>
    <description>The latest articles on Forem by Ghaleb Al-Nakhlani (@ghalib).</description>
    <link>https://forem.com/ghalib</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%2F119445%2F11091ecb-577f-4d26-88ab-58624211b722.jpg</url>
      <title>Forem: Ghaleb Al-Nakhlani</title>
      <link>https://forem.com/ghalib</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ghalib"/>
    <language>en</language>
    <item>
      <title>Render a component in HTML page</title>
      <dc:creator>Ghaleb Al-Nakhlani</dc:creator>
      <pubDate>Wed, 06 Jan 2021 14:11:03 +0000</pubDate>
      <link>https://forem.com/ghalib/render-a-component-in-html-page-7hl</link>
      <guid>https://forem.com/ghalib/render-a-component-in-html-page-7hl</guid>
      <description>&lt;p&gt;I have a react &lt;strong&gt;CookieBanner&lt;/strong&gt; component in the app /src and I would like to render this component in an HTML page placed in the Public folder. The component is working with the normal App.js and it rendered, I would like to have the same component in static HTML pages in the Public folder.&lt;/p&gt;

&lt;p&gt;Here are my &lt;strong&gt;routes.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Routes extends React.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            &amp;lt;div&amp;gt;
            &amp;lt;HelmetMetaData /&amp;gt;
            &amp;lt;Switch&amp;gt;
                &amp;lt;Route exact path="/" render={() =&amp;gt; {window.location.href="Home.html"}} /&amp;gt;
                &amp;lt;Route path="/Main" component={App}/&amp;gt;
                &amp;lt;Route path="/About" render={() =&amp;gt; {window.location.href="About.html"}}/&amp;gt;
                &amp;lt;Route path="/impressum" render={() =&amp;gt; {window.location.href="impressum.html"}}/&amp;gt;
                &amp;lt;Route path="/blog" render={() =&amp;gt; {window.location.href="blog.html"}}/&amp;gt;
                &amp;lt;Route path="/Questions" render={() =&amp;gt; {window.location.href="Questions.html"}} /&amp;gt;
                &amp;lt;Route path="/Answers" render={() =&amp;gt; {window.location.href="Answers.html"}} /&amp;gt;
                &amp;lt;Route path="/info" render={() =&amp;gt; {window.location.href="info.html"}} /&amp;gt;
                &amp;lt;Route component={Error}/&amp;gt;
            &amp;lt;/Switch&amp;gt;
            &amp;lt;/div&amp;gt;
        );
    }
};
export default Routes;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CookieBanner.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ReactDOM from "react-dom";
import React from "react";
import CookieConsent from "react-cookie-consent";

class CookieBanner extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            showCookie: false,
        };
    }

    componentDidMount() {
        setTimeout(function () { //Start the timer
            this.setState({showCookie: true}) //After 1 second, set render to true
        }.bind(this), 800)
    }

    render() {
        return (
            &amp;lt;div&amp;gt;
            {
                this.state.showCookie &amp;amp;&amp;amp; (
                    &amp;lt;CookieConsent
                        // debug={true}
                        location='bottom'
                        buttonText='Akzeptieren'
                        declineButtonText='Ablehnen'
                        enableDeclineButton
                        flipButtons={true}
                        cookieName='&amp;lt;cookieName&amp;gt;'
                        style={{background: "rgb(170, 165, 163)", padding: '0.2rem'}}
                        overlayStyle={{zIndex: '9999'}}
                        buttonStyle={{
                            color: 'rgb(255, 255, 255)',
                            fontSize: '16px',
                            backgroundColor: 'rgb(112, 173, 71)'
                        }}
                        declineButtonStyle={{color: 'rgb(192, 0, 0)', borderColor: 'transparent', backgroundColor: 'none', border: 'none', background:'transparent'}}
                        expires={150}
                        overlay&amp;gt;
                        {/*// onAccept={() =&amp;gt; {*/}
                        {/*//     alert("Accept was triggered by clicking the Accept button");*/}
                        {/*// }}*/}
                        {/*// onDecline={() =&amp;gt; {*/}
                        {/*//     alert("nay!");*/}
                        {/*// }}*/}
                       this is a cookie
                        &amp;lt;span style={{fontSize: '16px'}}&amp;gt;
                        &amp;lt;a style={{display: 'inline-block', padding: '0.2rem', textDecoration: 'underline'}}
                           role="button" href="/datenSchutz"&amp;gt;More information&amp;lt;/a&amp;gt;
                    &amp;lt;/span&amp;gt;
                    &amp;lt;/CookieConsent&amp;gt;)
            }
            &amp;lt;/div&amp;gt;
        );
    }
}

ReactDOM.render(&amp;lt;CookieBanner /&amp;gt;, document.getElementById("banner"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Migrate Create React App to Razzle</title>
      <dc:creator>Ghaleb Al-Nakhlani</dc:creator>
      <pubDate>Wed, 23 Dec 2020 22:49:54 +0000</pubDate>
      <link>https://forem.com/ghalib/migrate-create-react-app-to-razzle-3bof</link>
      <guid>https://forem.com/ghalib/migrate-create-react-app-to-razzle-3bof</guid>
      <description>&lt;p&gt;I have a project which was built using Create react app. I need now a server rendering for my App I found about Razzle it is the most simple method to implement.&lt;/p&gt;

&lt;p&gt;I have the /src which has all the components in addition a folder for images Also a few stuff in the public folder. And node_modules folder last I have the dependencies in the package.json&lt;/p&gt;

&lt;p&gt;Should I just copy paste them to Razzle? Which I have tried and I get errors webpack_require and TypeError: cannot read property 'prototype' of undefined?&lt;/p&gt;

&lt;p&gt;What is the best way to convert to Razzle?&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>react</category>
      <category>razzle</category>
      <category>ssr</category>
    </item>
    <item>
      <title>90% of Linux Commands</title>
      <dc:creator>Ghaleb Al-Nakhlani</dc:creator>
      <pubDate>Wed, 23 Sep 2020 23:13:25 +0000</pubDate>
      <link>https://forem.com/ghalib/90-of-linux-commands-5627</link>
      <guid>https://forem.com/ghalib/90-of-linux-commands-5627</guid>
      <description>&lt;p&gt;man &lt;br&gt;
sudo&lt;br&gt;
cd&lt;br&gt;
pwd&lt;br&gt;
ls&lt;br&gt;
clear&lt;br&gt;
bash&lt;br&gt;
ssh&lt;br&gt;
history&lt;br&gt;
grep&lt;br&gt;
whereis&lt;br&gt;
chmod&lt;br&gt;
chown&lt;br&gt;
find&lt;br&gt;
apt&lt;br&gt;
echo&lt;br&gt;
cat&lt;br&gt;
systemctl&lt;br&gt;
df&lt;br&gt;
htop&lt;br&gt;
rm&lt;br&gt;
mv&lt;br&gt;
mkdir&lt;br&gt;
cp&lt;br&gt;
nano&lt;br&gt;
ip&lt;br&gt;
netstat&lt;/p&gt;

&lt;p&gt;If you want to learn how to use the command just type in the terminal (man follwed by the command name)&lt;br&gt;
Example:&lt;br&gt;
Ubuntu@ubuntu$ man cd&lt;/p&gt;

&lt;p&gt;Your Welcome to add more commands in the comments, if i forgot to include them.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Why would you consider Linux over Windows?</title>
      <dc:creator>Ghaleb Al-Nakhlani</dc:creator>
      <pubDate>Mon, 07 Jan 2019 14:50:22 +0000</pubDate>
      <link>https://forem.com/ghalib/why-would-you-consider-linux-over-windows-12k8</link>
      <guid>https://forem.com/ghalib/why-would-you-consider-linux-over-windows-12k8</guid>
      <description>&lt;p&gt;I have noticed a lot of developers are using Linux. I want to hear from them why they prefer Linux over Windows. &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>linux</category>
      <category>operatingsystem</category>
      <category>developer</category>
    </item>
    <item>
      <title>What are the fundamentals of programming?</title>
      <dc:creator>Ghaleb Al-Nakhlani</dc:creator>
      <pubDate>Sat, 22 Dec 2018 13:03:13 +0000</pubDate>
      <link>https://forem.com/ghalib/what-are-the-fundamentals-of-programming-2i79</link>
      <guid>https://forem.com/ghalib/what-are-the-fundamentals-of-programming-2i79</guid>
      <description>&lt;p&gt;what are the core basic fundamentals of programming which if you learn it well you can easily switch between programming languages because the principles are the same in every language? I have been thinking about this for a while and searched a lot but couldn`t find the right answer to my question. I hope i can get a clear explanation from the experienced developer in DEV.to&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>beginners</category>
      <category>programming</category>
      <category>developer</category>
    </item>
  </channel>
</rss>
