Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

usePermission does not update state when permission is granted on mobile

Aperta
#2,628 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
44k
Fork
3.3k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di streamich/react-use

Tutte le issue di streamich/react-use

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.