question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BottomNavigation] Link docs

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

In my app, I use nextjs links for navigation items. But BottomNavigationItem doesn’t support Link (Next.js)

Examples 🌈

Motivation 🔦

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
topovikcommented, Jan 24, 2021

A simple solution:

import { useRouter } from "next/router";
const router = useRouter();

  const onLink = (href) => {
    router.push(href);
  };

return (
    <BottomNavigation
      value={value}
      onChange={(event, newValue) => {
        setValue(newValue);
      }}
      showLabels
      className={classes.root}
    >
          <BottomNavigationAction label="Recents" icon={<RestoreIcon />} onClick={() => onLink("/recent")} />
          <BottomNavigationAction label="Favorites" icon={<FavoriteIcon />} onClick={() => onLink("/favorites")} />
          <BottomNavigationAction label="Nearby" icon={<LocationOnIcon />} onClick={() => onLink("/nearby")} />
    </BottomNavigation>
  )
2reactions
tomsturgecommented, Mar 23, 2021

The problem we are facing is that the BottomNavigationAction creates a button element and we want an anchor tag. A link driven by JS on a button is detrimental for SEO

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bottom Navigation React component - Material UI - MUI
Bottom navigation bars display three to five destinations at the bottom of a screen. Each destination is represented by an icon and an...
Read more >
Bottom navigation - Material Design
Bottom navigation bars display three to five destinations at the bottom of a screen. Each destination is represented by an icon and an...
Read more >
BottomNavigationBar class - material library - Dart API
A material widget that's displayed at the bottom of an app for selecting among a small number of views, typically between three and...
Read more >
Navigating with Compose - Android Developers
The NavHost links the NavController with a navigation graph that ... To link the items in a bottom navigation bar to routes in...
Read more >
Bottom Tabs Navigator | React Navigation
A simple tab bar on the bottom of the screen that lets you switch between different routes. Routes are lazily initialized -- their...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found