chore: 🤖 start work on useDropArea

This commit is contained in:
streamich 2018-10-29 21:40:36 +01:00
parent 0ea533fd4d
commit 05da37fc18
2 changed files with 15 additions and 1 deletions

View File

@ -47,7 +47,7 @@
<br/>
<br/>
- [**UI**](./docs/UI.md)
- [`useAudio`](./docs/useAudio.md) &mdash; plays audio and exposes its controls. [![][img-demo]](https://codesandbox.io/s/5v7q47knwl)
- [`useAudio`](./docs/useAudio.md) &mdash; plays audio and exposes its controls. [![][img-demo]](https://codesandbox.io/s/2o4lo6rqy)
- [`useSpeech`](./docs/useSpeech.md) &mdash; synthesizes speech from a text string. [![][img-demo]](https://codesandbox.io/s/n090mqz69m)
- [`useVideo`](./docs/useVideo.md) &mdash; plays video, tracks its state, and exposes playback controls.
<br/>

14
src/useDropArea.ts Normal file
View 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;