Skip to content

Commit 1e8caaa

Browse files
committed
allow no animation
1 parent b86be54 commit 1e8caaa

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/moti/src/core/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export type TransitionConfigWithoutRepeats = (
4343
| ({ type?: 'spring' } & WithSpringConfig)
4444
| ({ type: 'timing' } & WithTimingConfig)
4545
| ({ type: 'decay' } & WithDecayConfig)
46+
| { type: 'no-animation' }
4647
) & {
4748
delay?: number
4849
}

packages/moti/src/core/use-motify.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ function animationConfig<Animate>(
215215
config[configKey] = transitionConfigForKey
216216
}
217217
}
218+
} else if (animationType === 'no-animation') {
219+
animation = (value) => value
220+
config = {}
221+
repeatCount = 0
218222
}
219223

220224
return {

0 commit comments

Comments
 (0)