-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64ccabe
commit 1d2401e
Showing
5 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# useSupported | ||
|
||
## 0.0.1 | ||
|
||
### Patch Changes | ||
|
||
- [`31c740f`](https://github.com/changeelog/react-hooks/commit/31c740ffefc5d198882820eccd79e5dc3fb528e3#diff-89a99f3436d90c4414b314d9a0d39795e0af40e3a22840bd8ede7275b2ed196c)- Introduced useSupported |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# useSupported | ||
|
||
SSR compatibility `isSupported` | ||
|
||
Please refer to the [documentation](#) for more information. | ||
|
||
## Installation | ||
|
||
```bash | ||
npx changeelog/reactuse@latest add useSupported | ||
``` | ||
|
||
## Contribution | ||
|
||
Yes please! See the [contributing guidelines](#) for more details! | ||
|
||
## License | ||
|
||
This project is licensed under the terms of the [MIT License](/LICENSE) |
2 changes: 1 addition & 1 deletion
2
...ilities/useSupported/useSupported.test.ts → ...eSupported/__tests__/useSupported.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './useSupported' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import { useSupported } from './useSupported' | ||
|
||
const UseSupportedDemo: React.FC = () => { | ||
const isClipboardSupported = useSupported(() => !!navigator.clipboard) | ||
|
||
return ( | ||
<div> | ||
<h1>Clipboard API Support</h1> | ||
{isClipboardSupported ? ( | ||
<p>Clipboard API is supported!</p> | ||
) : ( | ||
<p>Clipboard API is not supported.</p> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default UseSupportedDemo |