@shoutem/ui 9.0.4 → 9.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext, useEffect, useRef } from 'react';
|
|
1
|
+
import React, { useCallback, useContext, useEffect, useRef } from 'react';
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
3
|
import { useFocusEffect } from '@react-navigation/native';
|
|
4
4
|
import _ from 'lodash';
|
|
@@ -25,22 +25,17 @@ const ScrollView = ({ driver, onScroll, primary, style, ...otherProps }) => {
|
|
|
25
25
|
// we want to switch to appropriate animation driver. We use the following hook
|
|
26
26
|
// to derive the new driver and cascading styles before the actual navigation transition is done
|
|
27
27
|
// to avoid rerendering when the actual nav transition completes
|
|
28
|
-
useFocusEffect(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
setAnimationDriver,
|
|
32
|
-
} = animationDriverContext;
|
|
28
|
+
useFocusEffect(
|
|
29
|
+
useCallback(() => {
|
|
30
|
+
const { setAnimationDriver } = animationDriverContext;
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return () => {
|
|
39
|
-
if (prevAnimationDriver) {
|
|
40
|
-
setAnimationDriver(prevAnimationDriver);
|
|
32
|
+
if (setAnimationDriver) {
|
|
33
|
+
setAnimationDriver(animationDriver.current, primary);
|
|
41
34
|
}
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
|
|
36
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
+
}, []),
|
|
38
|
+
);
|
|
44
39
|
|
|
45
40
|
useEffect(() => {
|
|
46
41
|
if (driver && animationDriver.current !== driver) {
|
package/package.json
CHANGED
package/.vscode/settings.json
DELETED