<?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: Egbert Nierop</title>
    <description>The latest articles on DEV Community by Egbert Nierop (@egbertn).</description>
    <link>https://dev.to/egbertn</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%2F508307%2F9999ee83-8176-48f5-904c-95c9e39e6829.jpeg</url>
      <title>DEV Community: Egbert Nierop</title>
      <link>https://dev.to/egbertn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/egbertn"/>
    <language>en</language>
    <item>
      <title>Weird behavior on passing data within </title>
      <dc:creator>Egbert Nierop</dc:creator>
      <pubDate>Wed, 04 Nov 2020 22:27:57 +0000</pubDate>
      <link>https://dev.to/egbertn/weird-behavior-on-passing-data-within-2b1</link>
      <guid>https://dev.to/egbertn/weird-behavior-on-passing-data-within-2b1</guid>
      <description>&lt;p&gt;*** Does anybody have an idea why {index} in the Redirect is being always the last item of the items array????&lt;br&gt;
I am bumping my head against the wall for this. It should work?! Thanks.&lt;br&gt;
NOTE: Code removed for brevity.&lt;/p&gt;

&lt;p&gt;interface IRedirect {&lt;br&gt;&lt;br&gt;
    cat: number;&lt;br&gt;&lt;br&gt;
    slideId: number;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;const Redirect = (props: IRedirect) =&amp;gt; {&lt;br&gt;
    let hist = useHistory();&lt;br&gt;
    return (&lt;br&gt;
         {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        const pass = `/newsdetail/${props.cat}/${props.slideId}`; *&amp;lt;------------ ALWAYS the same number, not the index*

        hist.push(pass);

    }} className="readmore"&amp;gt;Read more ....
    &amp;lt;/Link&amp;gt;)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;export class NewsCarrousel extends Component&lt;br&gt;
{&lt;br&gt;
render() {&lt;br&gt;
        return (                    return ( {&lt;br&gt;
            items.map((m, index) =&amp;gt; {&lt;br&gt;
                return (&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            &amp;lt;Redirect cat={NewsCarrousel.curCategory} *slideId={index}/&amp;gt;*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

</description>
      <category>component</category>
      <category>redirect</category>
    </item>
  </channel>
</rss>
