Skip to content

fix(typescript): LottiePlayer fallback에서 DOM-safe props만 전달#47

Merged
ywkim merged 1 commit into
mainfrom
fix/lottie-player-fallback-props
Feb 16, 2026
Merged

fix(typescript): LottiePlayer fallback에서 DOM-safe props만 전달#47
ywkim merged 1 commit into
mainfrom
fix/lottie-player-fallback-props

Conversation

@ywkim

@ywkim ywkim commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

요약

fallback div에서 custom props 전달을 제한하여 React 콘솔 경고를 제거했습니다. keepLastFrame 등의 컴포넌트 props가 DOM 요소에 전달되는 문제를 해결합니다.

목적

LottiePlayer 컴포넌트가 클라이언트 사이드에서 로드되기 전에 fallback div를 렌더링할 때, keepLastFrame 같은 custom props가 DOM 요소에 전달되면서 React 경고가 발생합니다. DOM-safe props(className, style)만 fallback에 전달하고, 전체 props는 실제 Player 컴포넌트에만 전달하여 경고를 해결합니다.

주요 변경 사항

  • fallback div 수정: <div {...rest} /><div className={className} style={style} />
    • className과 style만 DOM에 안전하게 전달
  • Player 컴포넌트: className, style을 명시적으로 전달
    • keepLastFrame 등 모든 custom props는 ...rest로 전달

영향 범위

  • typescript/src/components/LottiePlayer.tsx
  • @aioia/core를 사용하는 모든 프로젝트 (aidol, buppy 등)

테스트

  • ✅ TypeScript 빌드 성공
  • ✅ React 콘솔 경고 완전 제거 (aidol에서 검증)
  • ✅ 기능 동작 확인

비고

  • 이전 PR #46에서 keepLastFrame prop을 타입에만 추가했으나 fallback 문제 미해결
  • 현재 commit으로 React 경고 완전 해결

🤖 Generated with Claude Code

React 경고 해결:
- fallback div에서 keepLastFrame 등 custom props 전달 방지
- className, style만 명시적으로 전달
- Player 컴포넌트에는 모든 props 전달

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 LottiePlayer 컴포넌트의 fallback div에 DOM에 안전하지 않은 props가 전달되어 React 콘솔 경고가 발생하는 문제를 해결합니다. 변경 사항은 classNamestyle prop만 fallback div에 명시적으로 전달하고, 나머지 props는 실제 Player 컴포넌트에 전달하도록 수정하여 문제를 정확하게 해결합니다. 코드는 깔끔하고 효과적이며, 설명된 문제를 잘 해결하고 있습니다. 좋은 수정입니다.

@ywkim ywkim merged commit bd14171 into main Feb 16, 2026
2 checks passed
@ywkim ywkim deleted the fix/lottie-player-fallback-props branch February 16, 2026 03:16
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant