File tree 5 files changed +48
-9
lines changed
5 files changed +48
-9
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ module.exports = {
3
3
jsxBracketSameLine : true ,
4
4
singleQuote : true ,
5
5
trailingComma : 'all' ,
6
+ semi : false ,
6
7
} ;
Original file line number Diff line number Diff line change 14
14
"react-native" : " 0.62.2" ,
15
15
"react-native-gesture-handler" : " ^1.6.1" ,
16
16
"react-native-reanimated" : " ^2.0.0-alpha.1" ,
17
+ "react-native-reanimated-1" : " npm:react-native-reanimated@^1.9.0" ,
17
18
"react-native-vector-icons" : " ^6.6.0"
18
19
},
19
20
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import { View } from 'react-native'
3
3
4
- const componentsToRender = 3000
4
+ const componentsToRender = 5000
5
5
6
6
export const HeavyLoad = ( ) => {
7
7
return (
Original file line number Diff line number Diff line change 1
- import React from 'react'
2
- import { Text } from '../Text'
1
+ import React , { useRef , useState } from 'react' ;
2
+ import { Transition , Transitioning } from 'react-native-reanimated' ;
3
+ import { Card } from '../Card' ;
4
+ import { CardContainer } from '../CardContainer' ;
5
+ import {
6
+ animationDuration ,
7
+ collapsedHeight ,
8
+ expandedHeight ,
9
+ initialHeight ,
10
+ } from '../constants' ;
11
+
12
+ const transition = (
13
+ < Transition . Change interpolation = "easeInOut" durationMs = { animationDuration } />
14
+ ) ;
15
+
16
+ export const Reanimated1 = ( { heavyLoad} ) => {
17
+ const ref = useRef ( ) ;
18
+ let [ height , setHeight ] = useState ( initialHeight ) ;
19
+
20
+ const onPress = ( ) => {
21
+ ref . current . animateNextTransition ( ) ;
22
+ setHeight ( height === expandedHeight ? collapsedHeight : expandedHeight ) ;
23
+ } ;
3
24
4
- export const Reanimated1 = ( ) => {
5
25
return (
6
- < Text style = { { margin : 20 , textAlign : 'center' } } >
7
- Checkout branch "reanimated1"
8
- </ Text >
9
- )
10
- }
26
+ < Transitioning . View ref = { ref } transition = { transition } >
27
+ < CardContainer >
28
+ < Card />
29
+ </ CardContainer >
30
+
31
+ < CardContainer style = { { height} } onPress = { onPress } >
32
+ < Card expandable heavyLoad = { heavyLoad } />
33
+ </ CardContainer >
34
+
35
+ < CardContainer >
36
+ < Card />
37
+ </ CardContainer >
38
+ </ Transitioning . View >
39
+ ) ;
40
+ } ;
Original file line number Diff line number Diff line change @@ -5527,6 +5527,13 @@ react-native-gesture-handler@^1.6.1:
5527
5527
invariant "^2.2.4"
5528
5528
prop-types "^15.7.2"
5529
5529
5530
+ " react-native-reanimated-1@npm:react-native-reanimated@^1.9.0 " :
5531
+ version "1.9.0"
5532
+ resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-1.9.0.tgz#38676c99dd585504fdc7331efb45e5f48ec7339a"
5533
+ integrity sha512-Aj+spgIHRiVv7ezGADxnSH1EoKrQRD2+XaSiGY0MiB/pvRNNrZPSJ+3NVpvLwWf9lZMOP7dwqqyJIzoZgBDt8w==
5534
+ dependencies :
5535
+ fbjs "^1.0.0"
5536
+
5530
5537
react-native-reanimated@^2.0.0-alpha.1 :
5531
5538
version "2.0.0-alpha.1"
5532
5539
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.0.0-alpha.1.tgz#d8d451aeb8e31b59e36664749a2c00c736c981e9"
You can’t perform that action at this time.
0 commit comments