UNPKG

@instructure/ui-react-utils

Version:

A React utility library made by Instructure Inc.

47 lines 1.16 kB
/** * --- * category: utilities/react * --- * Flag React component props as hack props. * Warnings will display in the console when hack props are used. * * ```js-code * class Example extends Component { * static propTypes = { * currentProp: PropTypes.func * } * } * export default hack(['hackProp'])(Example) * ``` * * @module hack * @param {array} hackProps * @param {string} message * @return {function} React component flagged as having hack props */ declare const hack: (...args: unknown[]) => (ComposedComponent: import("react").ComponentClass<any>) => any; export default hack; export { /** * --- * category: utilities/react * --- * Flag React component props as hack props. * Warnings will display in the console when hack props are used. * * ```js * class Example extends Component { * static propTypes = { * currentProp: PropTypes.func * } * } * export default hack(['hackProp'])(Example) * ``` * * @module hack * @param {array} hackProps * @param {string} message * @return {function} React component flagged as having hack props */ hack }; //# sourceMappingURL=hack.d.ts.map