Skip to content

Commit

Permalink
Merge branch 'callbacks' of https://github.com/nandorojo/moti into ca…
Browse files Browse the repository at this point in the history
…llbacks
  • Loading branch information
nandorojo committed Mar 27, 2023
2 parents 93c9eca + 6ebea8d commit afe3476
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/moti/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ export type InlineOnDidAnimate<Value> = (
*
* ```jsx
* <MotiView
* onDidAnimate={(key, finished, value, { attemptedValue }) => {
* if (key === 'opacity' && finished && attemptedValue === 1) {
* onDidAnimate={(finished, value, { attemptedValue }) => {
* if (finished && attemptedValue === 1) {
* console.log('animated to 1!')
* }
* }}
Expand Down
2 changes: 1 addition & 1 deletion packages/moti/src/core/use-motify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export function useMotify<Animate>({

let inlineOnDidAnimate: InlineOnDidAnimate<any> | undefined

if (typeof value == 'object' && 'onDidAnimate' in value) {
if (typeof value === 'object' && value && 'onDidAnimate' in value) {
inlineOnDidAnimate = value.onDidAnimate
value = value.value
}
Expand Down

0 comments on commit afe3476

Please sign in to comment.