# 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:** 1\
**Showing post:** 2

<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**.

---

_[View the full topic](https://community.dynatrace.com/t/how-to-do-navigation-via-button-in-react-app-engine/39293)._
