# How to do navigation via button in react - app engine

**URL:** <https://community.dynatrace.com/t/how-to-do-navigation-via-button-in-react-app-engine/39293>\
**Category:** Developer Q&A Forum\
**Tags:** apps, latest-dynatrace\
**Created:** [April 13, 2023, 3:38pm UTC](https://community.dynatrace.com/t/how-to-do-navigation-via-button-in-react-app-engine/39293 "2023-04-13T15:38:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwangxi](https://avatars.discourse-cdn.com/v4/letter/k/ccd318/32.png) [@kwangxi](https://community.dynatrace.com/u/kwangxi)\
**Post date:** [April 13, 2023, 3:38pm UTC](https://community.dynatrace.com/t/how-to-do-navigation-via-button-in-react-app-engine/39293/1 "2023-04-13T15:38:05Z")

</div>

Hi,

I wanted to navigate to the next page via a button. It will be via the onSelect method.

How should I exactly implement it specifically the navigation via all the buttons including return?

```auto
<span><TitleBar.Suffix><br></span><span> <ButtonWrapper><br></span><span> <Button </span>prefixIcon<span>=</span>{<span><HomeIcon /></span>} variant<span>="minimal" </span><span>><br></span> Home<br><span></Button><br></span><span> <Button </span>prefixIcon<span>=</span>{<span><DataTableIcon /></span>} variant<span>="minimal"</span><span>><br></span> Software<br><span></Button><br></span><span> <Button </span>prefixIcon<span>=</span>{<span><StackedBarChartIcon /></span>} variant<span>="minimal"</span><span>><br></span> Analytics<br><span></Button><br></span><span><br></span><span> </ButtonWrapper><br></span><span></TitleBar.Suffix></span>

```

---

<div class="post-metadata">

**Author:** ![robaxelsen](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/robaxelsen/32/39552_2.png) [@robaxelsen](https://community.dynatrace.com/u/robaxelsen)\
**Post date:** [June 13, 2023, 7:00am UTC](https://community.dynatrace.com/t/how-to-do-navigation-via-button-in-react-app-engine/39293/2 "2023-06-13T07:00:30Z")

</div>

Hi&nbsp;[@kwangxi](https://community.dynatrace.com/user/58678)&nbsp;:waving\_hand:

Sorry for the late reply, and maybe you’ve already solved this.

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:

```javascript
const clickHandler = () => {
  location.href = "https://google.com"
};
...
<Button onClick="clickHandler()">
  Click Me
</Button>

```

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 [\<Link /\>](https://developer.dynatrace.com/reference/design-system/preview/typography/Link/) component you can use. For the latter, you can use [React Router](https://reactrouter.com/), which is also included when you bootstrap your app with **dt-app**.
