<?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: Tejesh Agrawal</title>
    <description>The latest articles on DEV Community by Tejesh Agrawal (@tejesh_55).</description>
    <link>https://dev.to/tejesh_55</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%2F520453%2F775b7d66-9c05-4c35-be5a-341e98e8bfb5.jpeg</url>
      <title>DEV Community: Tejesh Agrawal</title>
      <link>https://dev.to/tejesh_55</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tejesh_55"/>
    <language>en</language>
    <item>
      <title>How to access passed data using router from one component to another ReactJS</title>
      <dc:creator>Tejesh Agrawal</dc:creator>
      <pubDate>Wed, 25 Nov 2020 01:07:26 +0000</pubDate>
      <link>https://dev.to/tejesh_55/how-to-access-passed-data-using-router-from-one-component-to-another-reactjs-56ii</link>
      <guid>https://dev.to/tejesh_55/how-to-access-passed-data-using-router-from-one-component-to-another-reactjs-56ii</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/64996762/how-to-access-passed-data-using-router-from-one-component-to-another-reactjs" rel="noopener noreferrer"&gt;
               How to access passed data using router from one component to another ReactJS
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Nov 25 '20&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 0&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/64996762/how-to-access-passed-data-using-router-from-one-component-to-another-reactjs" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;&lt;a href="https://i.stack.imgur.com/DsdId.png" rel="nofollow noreferrer"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZyJKBvtm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.stack.imgur.com/DsdId.png" alt="This is the error while accessing passed data variable from previous page using react-router"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//import routes from "./routes"
import { Link, withRouter, NavLink, useHistory } from "react-router-dom";

export default function App() {
  console.log(this.props.data.data);
  const [value1, setValue1] = useState(0);
  const [value2, setValue2] = useState(0);
...}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;This part of code in slider.js accessing data variable passed from last page, mentioned below&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;        axios
        .post(
          "/get_spec_other",
          {
            selected_country:&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/64996762/how-to-access-passed-data-using-router-from-one-component-to-another-reactjs" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


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