fix(typescript): LottiePlayer fallback에서 DOM-safe props만 전달#47
Merged
Conversation
React 경고 해결: - fallback div에서 keepLastFrame 등 custom props 전달 방지 - className, style만 명시적으로 전달 - Player 컴포넌트에는 모든 props 전달 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
이 PR은 LottiePlayer 컴포넌트의 fallback div에 DOM에 안전하지 않은 props가 전달되어 React 콘솔 경고가 발생하는 문제를 해결합니다. 변경 사항은 className과 style prop만 fallback div에 명시적으로 전달하고, 나머지 props는 실제 Player 컴포넌트에 전달하도록 수정하여 문제를 정확하게 해결합니다. 코드는 깔끔하고 효과적이며, 설명된 문제를 잘 해결하고 있습니다. 좋은 수정입니다.
|
🎉 This PR is included in version 2.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
fallback div에서 custom props 전달을 제한하여 React 콘솔 경고를 제거했습니다. keepLastFrame 등의 컴포넌트 props가 DOM 요소에 전달되는 문제를 해결합니다.
목적
LottiePlayer 컴포넌트가 클라이언트 사이드에서 로드되기 전에 fallback div를 렌더링할 때, keepLastFrame 같은 custom props가 DOM 요소에 전달되면서 React 경고가 발생합니다. DOM-safe props(className, style)만 fallback에 전달하고, 전체 props는 실제 Player 컴포넌트에만 전달하여 경고를 해결합니다.
주요 변경 사항
<div {...rest} />→<div className={className} style={style} />영향 범위
typescript/src/components/LottiePlayer.tsx테스트
비고
🤖 Generated with Claude Code