<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to do navigation via button in react - app engine in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-to-do-navigation-via-button-in-react-app-engine/m-p/214780#M357</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/58678"&gt;@kwangxi&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry for the late reply, and maybe you've already solved this.&lt;BR /&gt;&lt;BR /&gt;If not, I'll give you a few options. The most straightforward solution is to create a function to override location, and pass it as event handler on the button component:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const clickHandler = () =&amp;gt; {
  location.href = "https://google.com"
};
...
&amp;lt;Button onClick="clickHandler()"&amp;gt;
  Click Me
&amp;lt;/Button&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The best practice for this however, is to either use a component which allows for this in it's interface, or a router. For the former, the Strato design system has the &lt;A href="https://developer.dynatrace.com/reference/design-system/preview/typography/Link/" target="_blank" rel="noopener"&gt;&amp;lt;Link /&amp;gt;&lt;/A&gt; component you can use. For the latter, you can use &lt;A href="https://reactrouter.com/" target="_self"&gt;React Router&lt;/A&gt;, which is also included when you bootstrap your app with &lt;STRONG&gt;dt-app&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2023 07:18:10 GMT</pubDate>
    <dc:creator>robaxelsen</dc:creator>
    <dc:date>2023-06-13T07:18:10Z</dc:date>
    <item>
      <title>How to do navigation via button in react - app engine</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-to-do-navigation-via-button-in-react-app-engine/m-p/209805#M345</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to navigate to the next page via a button. It will be via the onSelect method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How should I exactly implement it specifically the navigation via all the buttons including return?&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;TitleBar.Suffix&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;ButtonWrapper&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;Button &lt;/SPAN&gt;prefixIcon&lt;SPAN&gt;=&lt;/SPAN&gt;{&lt;SPAN&gt;&amp;lt;HomeIcon /&amp;gt;&lt;/SPAN&gt;} variant&lt;SPAN&gt;="minimal" &lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt; Home&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/Button&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;Button &lt;/SPAN&gt;prefixIcon&lt;SPAN&gt;=&lt;/SPAN&gt;{&lt;SPAN&gt;&amp;lt;DataTableIcon /&amp;gt;&lt;/SPAN&gt;} variant&lt;SPAN&gt;="minimal"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt; Software&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/Button&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;Button &lt;/SPAN&gt;prefixIcon&lt;SPAN&gt;=&lt;/SPAN&gt;{&lt;SPAN&gt;&amp;lt;StackedBarChartIcon /&amp;gt;&lt;/SPAN&gt;} variant&lt;SPAN&gt;="minimal"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt; Analytics&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/Button&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;/ButtonWrapper&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/TitleBar.Suffix&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 May 2023 10:25:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-to-do-navigation-via-button-in-react-app-engine/m-p/209805#M345</guid>
      <dc:creator>kwangxi</dc:creator>
      <dc:date>2023-05-30T10:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to do navigation via button in react - app engine</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-to-do-navigation-via-button-in-react-app-engine/m-p/214780#M357</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/58678"&gt;@kwangxi&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry for the late reply, and maybe you've already solved this.&lt;BR /&gt;&lt;BR /&gt;If not, I'll give you a few options. The most straightforward solution is to create a function to override location, and pass it as event handler on the button component:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const clickHandler = () =&amp;gt; {
  location.href = "https://google.com"
};
...
&amp;lt;Button onClick="clickHandler()"&amp;gt;
  Click Me
&amp;lt;/Button&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The best practice for this however, is to either use a component which allows for this in it's interface, or a router. For the former, the Strato design system has the &lt;A href="https://developer.dynatrace.com/reference/design-system/preview/typography/Link/" target="_blank" rel="noopener"&gt;&amp;lt;Link /&amp;gt;&lt;/A&gt; component you can use. For the latter, you can use &lt;A href="https://reactrouter.com/" target="_self"&gt;React Router&lt;/A&gt;, which is also included when you bootstrap your app with &lt;STRONG&gt;dt-app&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 07:18:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/How-to-do-navigation-via-button-in-react-app-engine/m-p/214780#M357</guid>
      <dc:creator>robaxelsen</dc:creator>
      <dc:date>2023-06-13T07:18:10Z</dc:date>
    </item>
  </channel>
</rss>

