Skip to content

Commit

Permalink
address nandorojo#265
Browse files Browse the repository at this point in the history
  • Loading branch information
nandorojo committed Feb 14, 2023
1 parent 14d728b commit 4d5eeef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions examples/with-expo/src/Moti.Svg.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ComponentProps } from 'react'

import { Rect } from 'react-native-svg'
import { MotiView, useDynamicAnimation } from 'moti'
import { MotiView } from 'moti'
import { motifySvg } from '../../../packages/moti/src/svg'
import { useDerivedValue } from 'react-native-reanimated'

Expand All @@ -15,7 +15,6 @@ type Animate = Omit<
const animate: Animate = {}

export default function Svg() {
const animation = useDynamicAnimation<ComponentProps<typeof Rect>>(() => ({}))
return (
<MotiRect
// state={animation}
Expand Down
8 changes: 3 additions & 5 deletions packages/moti/src/svg/motify-svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ type AdditionalProps = {
}

export function motifySvg<
Props,
C extends React.ComponentClass<any> = React.ComponentClass<Props>,
Animate = ExcludeFunctionKeys<
Omit<React.ComponentPropsWithoutRef<C>, 'children'>
>
C extends React.ComponentClass<any>,
Props = React.ComponentPropsWithoutRef<C>,
Animate = ExcludeFunctionKeys<Omit<Props, 'children'>>
>(ComponentWithoutAnimation: C) {
const withAnimations = () => {
const AnimatedComponent = Animated.createAnimatedComponent(
Expand Down

0 comments on commit 4d5eeef

Please sign in to comment.