Source: react-imready/src/react-imready/useReady.tsx

  1. import { ImReadyReactiveProps } from "@egjs/imready";
  2. import { ReactImReadyResult, useImReady } from "./useImReady";
  3. /**
  4. * React hook to check if the images or videos are loaded. (only `useReady` and `useError` are true) Since this is deprecated, use useImReady instead.
  5. * @ko 이미지와 비디오들이 로드가 됐는지 체크하는 react hook.(`useReady`와 `useError`만 true) deprecated 되었으므로 useImReady를 이용해주세요.
  6. * @deprecated
  7. * @memberof ReactImReady
  8. * @param - React ImReady's props </ko>React ImReady의 props.</ko>
  9. * @example
  10. * ```js
  11. * import { useReady } from "@egjs/react-imready";
  12. *
  13. * function App() {
  14. * const {
  15. * register,
  16. * isReady,
  17. * hasError,
  18. * } = useReady({
  19. * selector: "img",
  20. * });
  21. * // &lt;div ref={register()}&gt;&lt;/div&gt;
  22. * }
  23. * ```
  24. */
  25. export function useReady(
  26. props: Partial<ImReadyReactiveProps> = {}
  27. ): ReactImReadyResult {
  28. return useImReady(props);
  29. }
comments powered by Disqus