mirror of
https://github.com/zhigang1992/devhub.git
synced 2026-06-10 23:39:22 +08:00
Not good. Super slow because there is too many animated components, need to optimize that. Lots of warnings on console like this: [Violation] 'requestAnimationFrame' handler took 1296ms #68
23 lines
690 B
TypeScript
23 lines
690 B
TypeScript
export * from 'react-native'
|
|
|
|
declare module 'react-native' {
|
|
export namespace Animated {
|
|
export type AnimatedComponent<
|
|
T extends React.ComponentClass
|
|
> = (T extends React.ComponentClass<infer P>
|
|
? React.ComponentClass<P>
|
|
: React.ComponentClass) & {
|
|
getNode(): InstanceType<T>
|
|
}
|
|
|
|
export function createAnimatedComponent<
|
|
T extends React.ComponentClass<any, any>
|
|
>(component: T): AnimatedComponent<T>
|
|
|
|
export const View: AnimatedComponent<typeof View>
|
|
export const Image: AnimatedComponent<typeof Image>
|
|
export const Text: AnimatedComponent<typeof Text>
|
|
export const ScrollView: AnimatedComponent<typeof ScrollView>
|
|
}
|
|
}
|