warnUtil.js 679 B

12345678910111213141516171819
  1. import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
  2. var _excluded = ["item"];
  3. import warning from "rc-util/es/warning";
  4. /**
  5. * `onClick` event return `info.item` which point to react node directly.
  6. * We should warning this since it will not work on FC.
  7. */
  8. export function warnItemProp(_ref) {
  9. var item = _ref.item,
  10. restInfo = _objectWithoutProperties(_ref, _excluded);
  11. Object.defineProperty(restInfo, 'item', {
  12. get: function get() {
  13. warning(false, '`info.item` is deprecated since we will move to function component that not provides React Node instance in future.');
  14. return item;
  15. }
  16. });
  17. return restInfo;
  18. }