Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

useWindowSize could return window width minus scrollbar

未关闭
#2,496 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@omwagh28 已经在做这个了。

开始于 2024年7月16日。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
frontend

调研方向

Start by reading the existing useWindowSize and useScrollbarWidth hooks to understand their current return values and scrollbar handling. Check how useWindowSize is tested, if tests are available, then add the proposed innerWidth and innerHeight values based on document.body.clientWidth and the corresponding height. Done means the hook exposes the new values with coverage for the scrollbar-related behavior.

由索引模型根据 Issue 内容生成。

描述

I realized useWindowSize returns the window's innerWidth which includes the scrollbar's width, if present, but also that I could use useScrollbarWidth to subtract it.

Why not add an innerWidth (and innerHeight) value to useWindowSize? It can be fetched using window.document.body.clientWidth.

主要语言
TypeScript
星标
44k
派生
3.3k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

streamich/react-use 的其他 Issue

查看 streamich/react-use 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。