react-use/src/useDropArea.ts
2018-10-29 21:40:36 +01:00

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;