Files
react-navigation/example
satyajit.happy 2573b5beaa feat: add Link component as useLinkTo hook for navigating to links
The `Link` component can be used to navigate to URLs. On web, it'll use an `a` tag for proper accessibility. On React Native, it'll use a `Text`.

Example:

```js
<Link to="/feed/hot">Go to 🔥</Link>
```

Sometimes we might want more complex styling and more control over the behaviour, or navigate to a URL programmatically. The `useLinkTo` hook can be used for that.

Example:

```js
function LinkButton({ to, ...rest }) {
  const linkTo = useLinkTo();

  return (
    <Button
      {...rest}
      href={to}
      onPress={(e) => {
        e.preventDefault();
        linkTo(to);
      }}
    />
  );
}
```
2020-04-27 17:45:20 +02:00
..
2020-02-14 18:32:53 +01:00
2020-01-30 05:03:31 +01:00
2019-12-09 15:20:28 +01:00
2020-04-07 15:44:58 +02:00
2020-01-10 13:12:32 +01:00
2020-03-22 23:58:06 +01:00
2020-01-10 13:12:32 +01:00
2020-03-22 23:58:06 +01:00
2020-04-07 15:44:58 +02:00
2020-03-22 23:58:06 +01:00

Example for React Navigation

If you want to run the example from the repo,

  • Clone the repository and run yarn in the project root
  • Run yarn example start to start the packager
  • Follow the instructions to open it with the Expo app

You can also run the currently published app on Expo on your Android device or iOS simulator or the web app in your browser.