mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
chore: 🤖 start work on useDropArea
This commit is contained in:
parent
0ea533fd4d
commit
05da37fc18
@ -47,7 +47,7 @@
|
||||
<br/>
|
||||
<br/>
|
||||
- [**UI**](./docs/UI.md)
|
||||
- [`useAudio`](./docs/useAudio.md) — plays audio and exposes its controls. [![][img-demo]](https://codesandbox.io/s/5v7q47knwl)
|
||||
- [`useAudio`](./docs/useAudio.md) — plays audio and exposes its controls. [![][img-demo]](https://codesandbox.io/s/2o4lo6rqy)
|
||||
- [`useSpeech`](./docs/useSpeech.md) — synthesizes speech from a text string. [![][img-demo]](https://codesandbox.io/s/n090mqz69m)
|
||||
- [`useVideo`](./docs/useVideo.md) — plays video, tracks its state, and exposes playback controls.
|
||||
<br/>
|
||||
|
||||
14
src/useDropArea.ts
Normal file
14
src/useDropArea.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
|
||||
const useDropArea = (el: React.ReactElement<any>) => {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (!React.isValidElement(el)) {
|
||||
throw new TypeError(
|
||||
'useDropArea first argument must be a valid ' +
|
||||
'React element, such as <div/>.'
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default useDropArea;
|
||||
Loading…
x
Reference in New Issue
Block a user