跳过导航
Front-end developers forgot how to store state in the URL. Everyone suffers.
0:00 / 1:46

Front-end developers forgot how to store state in the URL. Everyone suffers.

Bret Little

@little_bret1564 位关注者

在 X 上查看
5,192 个赞下载原帖

919,963 次观看

Front-end developers forgot how to store state in the URL. Everyone suffers.

10 条评论

评论来自 X (Twitter) 上的原帖

  • K.O.O x #SailsconfAF2025 的头像

    @Dominus_Kelvin

    🤣😂😅😂 Actually most newer frontend dev weren’t taught URL fragments and query params It’s all useState these days 😂😇

    168 个赞

  • Bret Little 的头像

    @little_bret

    Devs who don't know teaching devs who then also don't know. It's generational ignorance.

    114 个赞

  • Chris Esplin 的头像

    @ChrisEsplin

    She's stubborn. She's a Gemini. And of course she's spot on about the URL nav. But I take some issue with infinite scroll. It can be buggy to implement, and sometimes it's not worth it, even with IntersectionObserver. I usually advocate for pages or click-to-load when most users will never need additional pages of data.

    96 个赞

  • Bret Little 的头像

    @little_bret

    IMO if devs can't properly do back/forth navigation restoring state, then it's better to _not_ have infinite scroll at all. Most implementations are too user hostile.

    83 个赞

  • Tanner Linsley 的头像

    @tannerlinsley

    The energy here is💯

    65 个赞

  • joshpuckett 的头像

    @joshpuckett

    Inviting her to every design review *immediately*

    37 个赞

  • sven is your fren 的头像

    @strongpilled

    This such a true statement. URL state is state management on easy mode and a great benefit for users. Imagine queries and pagination without URL state?

    19 个赞

  • Bret Little 的头像

    @little_bret

    @svenasol It's not hard to imagine. It's everywhere! `const [page, setPage] = useState(0)`

    32 个赞

  • Jalik 的头像

    @jalik26

    I've never used infinite scrolling cause it sucks... URL query params are the way to go for initializing a page with custom params. Maybe beginners were not taught that..

    15 个赞

  • Bret Little 的头像

    @little_bret

    We also have `history.pushState` for SPAs, that no one uses! It's how we built our Pagination component to restore infinite scroll state on back/forward navigation:

    29 个赞