<?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: SteerClear90</title>
    <description>The latest articles on DEV Community by SteerClear90 (@steerclear90).</description>
    <link>https://dev.to/steerclear90</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%2F187198%2Fbcef0290-4100-4e0f-b3c4-66f0f4001149.png</url>
      <title>DEV Community: SteerClear90</title>
      <link>https://dev.to/steerclear90</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/steerclear90"/>
    <language>en</language>
    <item>
      <title>Using vendor chunk file from another application</title>
      <dc:creator>SteerClear90</dc:creator>
      <pubDate>Tue, 15 Mar 2022 19:34:29 +0000</pubDate>
      <link>https://dev.to/steerclear90/using-vendor-chunk-file-from-another-application-5b9l</link>
      <guid>https://dev.to/steerclear90/using-vendor-chunk-file-from-another-application-5b9l</guid>
      <description>&lt;p&gt;There is a react project where the vendor and &lt;em&gt;app code&lt;/em&gt; are split into separate files upon build.&lt;br&gt;
Can I load this &lt;em&gt;app code&lt;/em&gt; js file in another react project (say Project B) using only the Project B's vendor code and not using the vendor file which was generated during the creation of the &lt;em&gt;app code&lt;/em&gt; file?&lt;br&gt;
If it is possible I want to understand how the webpack configuration would be like.&lt;/p&gt;

&lt;p&gt;Note: I cannot build both project A and project B together in order to get a shared vendor file.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webpack</category>
      <category>javascript</category>
    </item>
    <item>
      <title>ReactJS widget on JSP page containing an other React application</title>
      <dc:creator>SteerClear90</dc:creator>
      <pubDate>Wed, 28 Jul 2021 17:47:47 +0000</pubDate>
      <link>https://dev.to/steerclear90/reactjs-widget-on-jsp-page-containing-an-other-react-application-5dc4</link>
      <guid>https://dev.to/steerclear90/reactjs-widget-on-jsp-page-containing-an-other-react-application-5dc4</guid>
      <description>&lt;p&gt;There is a JSP page on which we have a react application loading on a div element at present. I want to build an independent widget with React (kind of a chatbot) and add it to the same JSP. However, I do not want the react libraries of the existing app and widget to interfere each other. They might be of using different versions of react as well. Is there any way to embed entire react library and css with the widget bundle?&lt;/p&gt;

</description>
      <category>react</category>
      <category>webpack</category>
    </item>
    <item>
      <title>How to make http call onclick using stateless component in ReactJS?</title>
      <dc:creator>SteerClear90</dc:creator>
      <pubDate>Thu, 25 Jul 2019 15:13:48 +0000</pubDate>
      <link>https://dev.to/steerclear90/how-to-make-http-call-onclick-using-stateless-component-in-reactjs-4lo</link>
      <guid>https://dev.to/steerclear90/how-to-make-http-call-onclick-using-stateless-component-in-reactjs-4lo</guid>
      <description>&lt;p&gt;I have a React stateless function component (SFC). I want a user to click a button and onclick a http call will be made from the SFC and when the response is received, I want to open a modal. Is it something achievable using SFC? Or do I need to keep a stateful component?&lt;/p&gt;

&lt;p&gt;This is my code which makes the http call on load and then onClick opens the modal. But I want both the things to happen in sequence on the onClick event.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
function httpListCall(url) {
    const [list, setData] = React.useState(null);
    const [error, setError] = React.useState(null);
    React.useEffect(() =&amp;gt; {
        axios
            .get(url)
            .then(function (response) {
                setData(response.data.ResultList);
            })
            .catch(function (error) {
                setError(error);
            })
    }, []);
    return { list, error };
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const ListContainer = () =&amp;gt; {
    const { list, error } = httpListCall("/list.json"); //THIS IS ON LOAD NOW - I WANT TO CALL IT onClick
    const [modalShow, setModalShow] = React.useState(false);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return(
    &amp;lt;React.Fragment&amp;gt;
        &amp;lt;div&amp;gt;
           &amp;lt;button onClick={() =&amp;gt; setModalShow(true)}/&amp;gt; //WANT TO MAKE API CALL HERE AND THEN OPEN THE MODAL
        &amp;lt;/div&amp;gt;
        &amp;lt;ModalWidget show={modalShow} list={advisorList} error={error} onHide={() =&amp;gt; setModalShow(false)}/&amp;gt;
    &amp;lt;/React.Fragment&amp;gt;
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
export default ListContainer;
ReactDOM.render(&amp;lt;FindAdvisorContainer /&amp;gt;, document.getElementById("app"));

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have tried to make the http call from a function but it gives me an error: "Invalid hook call. Hooks can only be called inside of the body of a function component."&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>How can a react app be rendered in different non react webpages?</title>
      <dc:creator>SteerClear90</dc:creator>
      <pubDate>Thu, 27 Jun 2019 15:51:44 +0000</pubDate>
      <link>https://dev.to/steerclear90/can-a-react-app-be-rendered-in-different-non-react-webpages-3dgc</link>
      <guid>https://dev.to/steerclear90/can-a-react-app-be-rendered-in-different-non-react-webpages-3dgc</guid>
      <description>&lt;p&gt;I have a react app that does not include redux. The react app only has a small chatbox window that opens up in a modal. I want to render this react app in a few non-react websites some of which use normal js and some use jQuery. How can it be included?&lt;/p&gt;

&lt;p&gt;My application is using webpack and babel. I am not using redux.&lt;/p&gt;

&lt;p&gt;I am new to React and newer to this community. Thanks for helping!&lt;/p&gt;

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