mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
15 lines
347 B
TypeScript
15 lines
347 B
TypeScript
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;
|