Skip to content

Commit

Permalink
Fix the use of Pick type in type definition
Browse files Browse the repository at this point in the history
This change was originally made in mifi#111. Pick type only takes two parameters: https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys

The keys should be unioned with `|`. `'path'` and `'animationData'` are separated with `,` which makes them invalid. They also don't need to be picked from `AnimationConfig` since we already add them in explicitly.
  • Loading branch information
Rich Hong committed Mar 6, 2024
1 parent 0e9f665 commit 2d63837
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare module 'react-lottie-player' {
React.HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>> &
Partial<Pick<AnimationConfig<RendererType>, 'path', 'animationData', 'loop' | 'renderer' | 'rendererSettings' | 'audioFactory'>> & {
Partial<Pick<AnimationConfig<RendererType>, 'loop' | 'renderer' | 'rendererSettings' | 'audioFactory'>> & {
play?: boolean
goTo?: number
speed?: number
Expand Down

0 comments on commit 2d63837

Please sign in to comment.