Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

useWindowSize could return window width minus scrollbar

Đang mở
#2,496 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

@omwagh28 đang làm issue này rồi.

Từ ngày 16/7/2024.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
44k
Fork
3.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của streamich/react-use

Tất cả issue của streamich/react-use

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.