nandorojo / moti

🐼 The React Native (+ Web) animation library, powered by Reanimated 3.
https://moti.fyi
MIT License
3.9k stars 120 forks source link

HOC MotiPressable error typescript #307

Closed lobor closed 10 months ago

lobor commented 10 months ago

Is there an existing issue for this?

Do you want this issue prioritized?

Current Behavior

image

Exported variable 'ButtonFrame' has or is using name 'DecayConfig' from external module "/srv/crossed/node_modules/.pnpm/react-native-reanimated@3.4.2_6syixf76bqx5r4tgwtwyqyssoi/node_modules/react-native-reanimated/lib/typescript/reanimated2/animation/decay" but cannot be named.
export const styled = <
  P extends Record<string, any> = {},
  T extends ConfigSchema<P> = {}
>(
  Component: ComponentType<P> & { styles?: any },
  themeConfigProps: ConfigSchemaTheme<P, T>
) => {

Expected Behavior

I want extends props off MotiPressable, if you replace by simple Pressable, this work

Steps To Reproduce

I use pnpm@7

git clone https://github.com/lobor/crossed.git cd ./crossed pnpm i pnpm watch Build not work because type checking error, but pnpm watch ignores it

open file packages/ui/src/forms/Button.tsx and see error on line 34 styled function is in packages/core/src/styled.tsx

Versions

- Moti: 0.26.0
- Reanimated: 3.4.2
- React Native: 0.72.3

Screenshots

No response

Reproduction

I use pnpm@7

repo project https://github.com/lobor/crossed

git clone https://github.com/lobor/crossed.git cd ./crossed pnpm i pnpm watch Build not work because type checking error, but pnpm watch ignores it

open file packages/ui/src/forms/Button.tsx and see error on line 34 styled function is in packages/core/src/styled.tsx

lobor commented 10 months ago

I close this issue simple add

export type * as Moti from 'moti';
export type * as RnR from 'react-native-reanimated';

fix problem