diff --git a/README.md b/README.md index 637eab3c..1b63a1ad 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@

- [**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.
diff --git a/src/useDropArea.ts b/src/useDropArea.ts new file mode 100644 index 00000000..9710b709 --- /dev/null +++ b/src/useDropArea.ts @@ -0,0 +1,14 @@ +import * as React from 'react'; + +const useDropArea = (el: React.ReactElement) => { + if (process.env.NODE_ENV !== 'production') { + if (!React.isValidElement(el)) { + throw new TypeError( + 'useDropArea first argument must be a valid ' + + 'React element, such as
.' + ); + } + } +}; + +export default useDropArea;