-
-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/moti support component config #2319
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Code looks a bit complex to me. The transform issue makes sense and should be an easy fix though. |
Oh sorry thought this was a PR on the moti repo |
But yeah I can fix this upstream |
thanks! |
@TheEhsanSarshar can you try moti 0.28.1? Should be fixed there. |
For shorthands, what if you just did it before the createAnimations(animations) {
const shorthands = { x: 'translateX', y: 'translateY' }
for (const animationKey in animations) {
for (const shorthand in shorthands) {
if (animations[animationKey][shorthand]) {
const styleName = shorthands[shorthand]
animations[animationKey][styleName] = animations[animationKey][shorthand]
}
}
}
return { ... }
} Then in Where |
: props.animation | ||
const normalizedAnimationObject = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use a for loop and a single object, should be quite a bit more performance sensitive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for the animationObject above probably we can do everything in one loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank! updated
@nandorojo for now we only have |
What I suggested is better |
5db8620
to
192a55b
Compare
know issues
for some reason
translateX: { type: 'spring', overshootClamping: true }
doesn't work, but if I usetransform
instead it works.@nandorojo probably an issue in moti
useMotify()