惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 聂微东
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
博客园 - Franky
小众软件
小众软件
罗磊的独立博客
G
Google Developers Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
腾讯CDC
N
Netflix TechBlog - Medium
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Latest
Security Latest
T
Threatpost
L
LINUX DO - 热门话题
P
Privacy & Cybersecurity Law Blog
J
Java Code Geeks
T
Threat Research - Cisco Blogs
V2EX - 技术
V2EX - 技术
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
NISL@THU
NISL@THU
M
MIT News - Artificial intelligence
Cisco Talos Blog
Cisco Talos Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Heimdal Security Blog
The Last Watchdog
The Last Watchdog
量子位
P
Palo Alto Networks Blog
W
WeLiveSecurity
H
Hacker News: Front Page
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园_首页
爱范儿
爱范儿
V
Vulnerabilities – Threatpost
Engineering at Meta
Engineering at Meta
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Security Affairs
云风的 BLOG
云风的 BLOG
A
About on SuperTechFans
A
Arctic Wolf
大猫的无限游戏
大猫的无限游戏
T
The Exploit Database - CXSecurity.com
Hacker News: Ask HN
Hacker News: Ask HN
C
Cisco Blogs
Jina AI
Jina AI

Software and Tech stories from an Insider - iDiallo.com

I turned my prologue into a short video The Laziest Generation All Chinese Models Will Be Illegal in 3... 2... 1... Everything you say CAN and WILL be used against you Happy Father's Day. I know Kung-fu Debugging on Prod I can never fully embrace LLMs for code ppclp.ai announces 100x Productivity Gains Why all the PRs? Now that your newsletter is AI-generated, I've Unsubscribed Now that your newsletter is AI-generated, I've Unsubscribed The web is changing, and we are not going back The web is changing, and we are not going back How Many Tokens Did You Burn Today How Many Tokens Did You Burn Today Amber Alert sends Spam URL? Amber Alert sends Spam URL? The commencement speech that shook the world The commencement speech that shook the world How to Talk to Your Coworkers How to Talk to Your Coworkers Don't call yourself a Software Engineer, and other Career Advice Don't call yourself a Software Engineer, and other Career Advice In the Empire's Defense In the Empire's Defense It's funny because it's true It's funny because it's true Software engineers are obsolete... for now We Are Not Going to Agree on AI Hi stranger
Please, use a link!
Ibrahim Diallo · 2026-06-11 · via Software and Tech stories from an Insider - iDiallo.com

This is a rant. It didn't start today, but I think I've reached the end of the line. The straw that broke the camel's back, so to say. I used an internal tool for the first time. I logged in and navigated through the web app, making some updates here and there. All was well. But then I made the mistake of wanting to go back to the initial dashboard. I clicked the back button, and instead of returning to the previous page, I saw Chrome's default tab page staring right back at me.

How is it possible? I had navigated through at least a dozen pages, yet one back button click and the web app was completely gone. If you've ever experienced something similar, it's probably because you were using a single-page app. Nothing wrong with single-page apps, of course, but over the years I've concluded that people who only know how to build single-page apps don't know what a link is.

So let's start with examples of what a link isn't.

<div onclick="navigate('home')">Home</div>

Not a link. It's a div with an onclick event handler. You can style it all you want, but it's not a link.

<button onclick="navigate('home')">Home</button>

This may be a button, but it is not a link. With the advent of React, this has become so common. Because it's called a button, learners naturally gravitate toward it to link different pages. But there is worse.

square hole

<a onclick="navigate('home')">Home</a>

This almost feels intentional. As if the developer is teasing me. Why would you use an anchor tag but then omit its most important attribute? Here is what a link is supposed to look like:

<a href="/home">Home</a>

That's it. Simple. You don't have to add any configuration for the browser to support it. You don't even have to style it. All user agents have sensible default styling for the different states of a link: unvisited, visited, and active. It works well with browser history. On desktop, when you hover over it, you get a preview of the destination URL in the bottom-left corner of your screen. On mobile, you can press and hold to get several options on how to open it. You don't even have to worry about accessibility. It just works.

But when a developer is deep in their React app thinking about functionality, they might say, "When you click this button, go to the home page." They will naturally think of onClick as an event. And since it's a single-page app, they're thinking about state, not a page. They might write something like this:

import { navigate } from 'somewhere'; 
function Home() {
  return (
    <div style={{ padding: '20px' }}>
      <h1>Home Page</h1>

      <button onClick={() => navigate('/about')}>
        Go to About Page
      </button>
      <div 
        onClick={() => navigate('/about')} 
        style={{ cursor: 'pointer', marginTop: '10px', color: 'blue' }}
      >
        Click this text to navigate
      </div>
    </div>
  );
}
export default Home;

This is already bad enough. But depending on how the navigate function is implemented, it can make or break the entire browser history. In the internal tool I was using, navigate was essentially replacing the current URL with the new one using location.replace().

You can avoid all of these issues by just using an anchor tag. If you need it to play nicely with your React app, React Router has a Link component.

import { Link } from 'react-router-dom';
function Navbar() {
  return (
    <nav>
      <Link to="/home">Home</Link>
    </nav>
  );
}

Please, just use a native link and you won't have to worry about anything else.