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

usePermission does not update state when permission is granted on mobile

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

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Start at the usePermission hook entry point and reproduce the camera-permission flow on iOS Chrome, comparing it with desktop behavior. Investigate how the hook observes permission changes and verify that granting camera access changes the reported state to granted on mobile.

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

Mô tả

What is the current behavior?

My code:

const state = usePermission({ name: "camera: })

console.log(state) // One of prompt, granted or denied

This works fine on desktop - when user grants permission, the state updates from prompt to granted. However, on google chrome mobile the state does not update.

Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-use. Paste the link to your JSFiddle or CodeSandbox example below:

Just try the usePermission hook with camera on google chrome mobile - you will see the bug/

What is the expected behavior?

The state should update to granted on mobile too

A little about versions:

  • OS: iOS
  • Browser (vendor and version): Google Chrome
  • React: 18.3
  • react-use: 17.6
  • Did this worked in the previous package version? Didn't check

This could be due to limited support of Permission API in google chrome mobile - in which case would like to know a workaround

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.