<?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: Kumar</title>
    <description>The latest articles on DEV Community by Kumar (@kumar123).</description>
    <link>https://dev.to/kumar123</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%2F1172327%2F67008d83-54b5-4b95-a3c6-16a1a01ebe28.png</url>
      <title>DEV Community: Kumar</title>
      <link>https://dev.to/kumar123</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kumar123"/>
    <language>en</language>
    <item>
      <title>How to open and close menu by event 'onMouseOver&amp;onMouseLeave' in React JS Material ui</title>
      <dc:creator>Kumar</dc:creator>
      <pubDate>Thu, 28 Sep 2023 11:54:20 +0000</pubDate>
      <link>https://dev.to/kumar123/how-to-open-and-close-menu-by-event-onmouseoveronmouseleave-in-react-js-material-ui-eh4</link>
      <guid>https://dev.to/kumar123/how-to-open-and-close-menu-by-event-onmouseoveronmouseleave-in-react-js-material-ui-eh4</guid>
      <description>&lt;p&gt;I'm beginner to react JS and I want to show a drop-down list of items whenever a user hovers on the button without having to click on the button for this I have tried this below code but it is not working fine.&lt;/p&gt;

&lt;p&gt;I have referred this &lt;a href="https://stackoverflow.com/questions/60912870/how-to-open-material-ui-menu-when-hover-on-a-button"&gt;example&lt;/a&gt; and here showing only &lt;code&gt;onMouseOver&lt;/code&gt; event but I want to use &lt;code&gt;onMouseOver&amp;amp;onMouseLeave&lt;/code&gt; this two events when use Over and Leave the button.&lt;/p&gt;

&lt;p&gt;Suggest me where I did the mistake and how to achieve this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import * as React from 'react';
import Button from '@mui/material/Button';
import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import Fade from '@mui/material/Fade';
import { Container,Link } from '@mui/material';


function FadeMenu() {

const [anchorEl, setAnchorEl] = React.useState(null);
const [open, setOpen] = React.useState(false);

    const handleOver = (event) =&amp;gt; {
        setAnchorEl(event.currentTarget);
setOpen(true);
    }

    const handleLeave = (event) =&amp;gt; {

        setAnchorEl(null);
        setOpen(false);
    }

    const handleClose = (event) =&amp;gt; {
        setAnchorEl(null);
    };

 return (

&amp;lt;Button
                id="about-fade-button"
                aria-controls="about-fade-menu"
                aria-haspopup="true"
                aria-expanded={open ? 'about-fade-menu' : 'false'}
                onMouseOver={handleOver}
                onMouseLeave={handleLeave}
                sx={{cursor:"pointer",textTransform:"none",fontSize:"14px",
                '&amp;amp;:hover':{color:"#30B54B",textDecoration:"underline",
            textDecorationThickness:"2px"},}}
            &amp;gt;
                About
            &amp;lt;/Button&amp;gt;
            &amp;lt;Menu
                id="about-fade-menu"
                MenuListProps={{
                    'aria-labelledby': 'about-fade-button',
                }}
                anchorEl={anchorEl}
                open={open}
                onClose={handleClose}
                TransitionComponent={Fade}
            &amp;gt;
                &amp;lt;MenuItem onClick={handleClose}&amp;gt;1&amp;lt;/MenuItem&amp;gt;
                &amp;lt;MenuItem onClick={handleClose}&amp;gt;2&amp;lt;/MenuItem&amp;gt;
                &amp;lt;MenuItem onClick={handleClose}&amp;gt;3&amp;lt;/MenuItem&amp;gt;
            &amp;lt;/Menu&amp;gt;



            &amp;lt;Button
                id="helpcenter-fade-button"
                aria-controls="helpcenter-fade-menu"
                aria-haspopup="true"
                aria-expanded={open ? 'helpcenter-fade-menu' : 'false'}
                onMouseOver={handleOver}
                onMouseLeave={handleLeave}
                sx={{cursor:"pointer",textTransform:"none",fontSize:"14px",
                '&amp;amp;:hover':{color:"#30B54B",textDecoration:"underline",textDecorationStyle:"solid",
            textDecorationThickness:"2px"},}}
            &amp;gt;
                Help Center
            &amp;lt;/Button&amp;gt;
            &amp;lt;Menu
                id="helpcenter-fade-menu"
                MenuListProps={{
                    'aria-labelledby': 'helpcenter-fade-button',
                }}
                anchorEl={anchorEl}
                open={open}
                onClose={handleClose}
                TransitionComponent={Fade}
            &amp;gt;
                &amp;lt;MenuItem onClick={handleClose}&amp;gt;4&amp;lt;/MenuItem&amp;gt;
                &amp;lt;MenuItem onClick={handleClose}&amp;gt;5&amp;lt;/MenuItem&amp;gt;
                &amp;lt;MenuItem onClick={handleClose}&amp;gt;6&amp;lt;/MenuItem&amp;gt;
            &amp;lt;/Menu&amp;gt;

);

}

export default FadeMenu;

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

&lt;/div&gt;



</description>
      <category>react</category>
    </item>
    <item>
      <title>Getting axioserror network error at xmlhttprequest.handleerror when calling axios post request in react</title>
      <dc:creator>Kumar</dc:creator>
      <pubDate>Thu, 28 Sep 2023 11:45:13 +0000</pubDate>
      <link>https://dev.to/kumar123/getting-axioserror-network-error-at-xmlhttprequesthandleerror-when-calling-axios-post-request-in-react-5g7a</link>
      <guid>https://dev.to/kumar123/getting-axioserror-network-error-at-xmlhttprequesthandleerror-when-calling-axios-post-request-in-react-5g7a</guid>
      <description>&lt;p&gt;I am new to this React.js axios concept and when I try to call axios.get, I get &lt;code&gt;AxiosError: Network Error&lt;/code&gt; I'm not sure why this error is coming and I have read &lt;a href="https://stackoverflow.com/questions/56297420/getting-network-error-when-calling-axios-get-request-in-react-js"&gt;this&lt;/a&gt; and &lt;a href="https://www.brainstormcreative.co.uk/react-js/use-axios-in-react-to-post-api-data-example/"&gt;this&lt;/a&gt; some other examples also but I didn't get the proper solution.&lt;/p&gt;

&lt;p&gt;And I have install the below two commands &lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install axios&lt;/code&gt; and &lt;code&gt;npm install cors&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OvUqJHB2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ywga62tqob1f0eo3do10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OvUqJHB2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ywga62tqob1f0eo3do10.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below is my code :-&lt;br&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 { Button } from "@mui/material";
import axios from "axios";

function GetApiData() {

var data = {
    vendorname: "achintya",
      };

      const postData = () =&amp;gt; {
        axios({
          method: "post",
          baseURL: "https://somesite.com",
          url: "/bkdb_getvendorcodes",
          payload: data,
        })
          .then(function (response) {
            // handle success
            console.log(response);
          })
          .catch(function (error) {
            // handle error
            console.log(error);//showing error here 
          });
      };

    return (
        &amp;lt;&amp;gt;
            &amp;lt;Button variant="outlined" onClick={postData}&amp;gt;POST data&amp;lt;/Button&amp;gt;
        &amp;lt;/&amp;gt;
    );
}

export default GetApiData;

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

&lt;/div&gt;



&lt;p&gt;When I run the above code I'm getting the below error&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8DEiJBMs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bf4eszwa0ly8ov56ffbm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8DEiJBMs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bf4eszwa0ly8ov56ffbm.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But the service is working fine example img&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6CwnGJTO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/riuapyffmcul9dqzcz3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6CwnGJTO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/riuapyffmcul9dqzcz3m.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I don't have much knowledge to fix this error please suggest me where I did the mistake and how to achieve this.&lt;/p&gt;

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