Skip to content

[BUG]: @toss/use-overlay requstAnimatilFrame 에 콜백 등록 후 clear 하는 로직이 없음. #523

Closed
@starguide0

Description

@starguide0

Package Scope

Package name: @toss/use-overlay

Describe the bug

requestAnimationFrame 등록 이후 cancelAnimationFrame 호출 하는 곳이 없음

Expected behavior

useEffect 의 cleanup 를 이용해서 등록된 animation 콜백을 clear 했으면 함

Possible Solution

// OverlayController.tsx

useEffect(() => {
  // NOTE: requestAnimationFrame이 없으면 가끔 Open 애니메이션이 실행되지 않는다.
  const animation = requestAnimationFrame(() => {
    setIsOpenOverlay(true);
  });
  return ()=>{
    cancelAnimationFrame(animation);
  };
}, []);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions