Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hook): add usePermission hook #113

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tevass
Copy link
Contributor

@tevass tevass commented Feb 3, 2025

Pull Request Description:

Summary:

This pull request introduces a new usePermission() hook mentioned in #95, enabling easy check browser permissions for querying status for various browser APIs in React applications.

Usage

import { usePermission } from 'react-haiku';

export const Component = () => {
  const state = usePermission("geolocation")

  return (
    <div>
      <h3>Permission state: {state}</h3>
    </div>
  );
}

@tevass tevass closed this Feb 3, 2025
@tevass tevass deleted the feat/95-use-permission branch February 3, 2025 15:21
@tevass tevass restored the feat/95-use-permission branch February 3, 2025 15:22
@tevass tevass reopened this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant