Skip to content

Commit

Permalink
allow no animation
Browse files Browse the repository at this point in the history
  • Loading branch information
nandorojo committed Aug 7, 2023
1 parent b86be54 commit 1e8caaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/moti/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type TransitionConfigWithoutRepeats = (
| ({ type?: 'spring' } & WithSpringConfig)
| ({ type: 'timing' } & WithTimingConfig)
| ({ type: 'decay' } & WithDecayConfig)
| { type: 'no-animation' }
) & {
delay?: number
}
Expand Down
4 changes: 4 additions & 0 deletions packages/moti/src/core/use-motify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ function animationConfig<Animate>(
config[configKey] = transitionConfigForKey
}
}
} else if (animationType === 'no-animation') {
animation = (value) => value
config = {}
repeatCount = 0
}

return {
Expand Down

1 comment on commit 1e8caaa

@vercel
Copy link

@vercel vercel bot commented on 1e8caaa Aug 7, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.