Skip to content

Commit f73c0a4

Browse files
authored
Merge pull request #8 from lukailun/develop
v1.5.1
2 parents aed9093 + 9a5684c commit f73c0a4

File tree

8 files changed

+1366
-573
lines changed

8 files changed

+1366
-573
lines changed

CHANGELOG.md

Lines changed: 33 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,58 @@
11
# Changelog
22

3-
## <small>1.4.3 (2025-04-22)</small>
4-
5-
* fix: downgrade react-native-builder-bob to 0.37.0 ([4ee989c](https://github.com/lukailun/react-native-animated-header-flat-list/commit/4ee989c))
6-
* fix: downgrade react-native-builder-bob to exact version ([f165587](https://github.com/lukailun/react-native-animated-header-flat-list/commit/f165587))
7-
* fix: update stickyHeaderContainer style to fix ui glitch on web ([5609919](https://github.com/lukailun/react-native-animated-header-flat-list/commit/5609919))
8-
* chore: add keywords flat-list and animated to package.json ([889a0fe](https://github.com/lukailun/react-native-animated-header-flat-list/commit/889a0fe))
9-
* chore: downgrade commitlint to v19.6.1 ([24e1859](https://github.com/lukailun/react-native-animated-header-flat-list/commit/24e1859))
10-
* chore: revert dependencies to previous versions ([92b5585](https://github.com/lukailun/react-native-animated-header-flat-list/commit/92b5585))
11-
* chore: update dependencies ([679098d](https://github.com/lukailun/react-native-animated-header-flat-list/commit/679098d))
12-
* chore: update dependencies ([219457b](https://github.com/lukailun/react-native-animated-header-flat-list/commit/219457b))
13-
* chore: update dependencies ([9649a3b](https://github.com/lukailun/react-native-animated-header-flat-list/commit/9649a3b))
14-
* chore: update dependencies ([6f37826](https://github.com/lukailun/react-native-animated-header-flat-list/commit/6f37826))
15-
* chore: update dependencies ([e522f02](https://github.com/lukailun/react-native-animated-header-flat-list/commit/e522f02))
16-
* chore: update dependencies ([4be6712](https://github.com/lukailun/react-native-animated-header-flat-list/commit/4be6712))
17-
* chore: update dependencies ([4912b49](https://github.com/lukailun/react-native-animated-header-flat-list/commit/4912b49))
18-
* chore: update dependencies ([72e7124](https://github.com/lukailun/react-native-animated-header-flat-list/commit/72e7124))
19-
* chore: update dependencies ([ce68d62](https://github.com/lukailun/react-native-animated-header-flat-list/commit/ce68d62))
20-
* chore: update dependencies ([128662f](https://github.com/lukailun/react-native-animated-header-flat-list/commit/128662f))
21-
* chore: update release-it config to use CHANGELOG.md ([7ef43f1](https://github.com/lukailun/react-native-animated-header-flat-list/commit/7ef43f1))
22-
23-
## [1.4.2](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.4.1...v1.4.2) (2025-04-08)
24-
25-
26-
### Bug Fixes
27-
28-
* optimize sticky component display after layout completion ([4a4d7e8](https://github.com/lukailun/react-native-animated-header-flat-list/commit/4a4d7e8118dab3d23ff0983c36546511c9f912ce))
29-
30-
## [1.4.1](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.4.0...v1.4.1) (2025-03-19)
3+
## <small>1.5.1 (2025-06-19)</small>
314

5+
* docs: remove navigation prop dependency from AnimatedHeaderFlatList component ([3ddcf50](https://github.com/lukailun/react-native-animated-header-flat-list/commit/3ddcf50))
326

33-
### Bug Fixes
7+
## 1.5.0 (2025-06-19)
348

35-
* add eslint disable comment to metro config ([64f5123](https://github.com/lukailun/react-native-animated-header-flat-list/commit/64f512362359043fab1fb03120664e45b16d763d))
36-
* convert babel config to commonjs ([4df90d8](https://github.com/lukailun/react-native-animated-header-flat-list/commit/4df90d86d4634b18433384699ff28ee25adba413))
9+
* style: fix linting issues and formatting ([0bbc213](https://github.com/lukailun/react-native-animated-header-flat-list/commit/0bbc213))
10+
* chore: release 1.4.3 ([25a6c67](https://github.com/lukailun/react-native-animated-header-flat-list/commit/25a6c67))
11+
* chore: update dependencies ([345783c](https://github.com/lukailun/react-native-animated-header-flat-list/commit/345783c))
12+
* chore: update dependencies to latest versions ([e25688b](https://github.com/lukailun/react-native-animated-header-flat-list/commit/e25688b))
13+
* chore: update dependencies to React 19 and React Native 0.79.2 ([833f0ab](https://github.com/lukailun/react-native-animated-header-flat-list/commit/833f0ab))
14+
* chore: update README ([7516c27](https://github.com/lukailun/react-native-animated-header-flat-list/commit/7516c27))
3715

38-
# [1.4.0](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.3.1...v1.4.0) (2025-03-10)
39-
40-
41-
### Bug Fixes
42-
43-
* use any type for navigation prop temporarily ([ef8c9b4](https://github.com/lukailun/react-native-animated-header-flat-list/commit/ef8c9b48c16a8beffd664e375c47576d5bb52cd0))
44-
45-
## [1.3.1](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.3.0...v1.3.1) (2025-01-21)
46-
47-
### Bug Fixes
16+
## <small>1.4.3 (2025-04-22)</small>
4817

49-
- change navigation prop type to any ([33377cf](https://github.com/lukailun/react-native-animated-header-flat-list/commit/33377cfcbfd3822a118752a7e6963b646bf3b15c))
50-
- update navigation type ([889d916](https://github.com/lukailun/react-native-animated-header-flat-list/commit/889d91616cad6a1aac7134f79a7307a22800b65c))
18+
* fix: update stickyHeaderContainer style to fix ui glitch on web ([5609919](https://github.com/lukailun/react-native-animated-header-flat-list/commit/5609919))
5119

52-
# [1.3.0](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.3...v1.3.0) (2025-01-21)
20+
## <small>1.4.2 (2025-04-08)</small>
5321

54-
### Features
22+
* fix: optimize sticky component display after layout completion ([4a4d7e8](https://github.com/lukailun/react-native-animated-header-flat-list/commit/4a4d7e8118dab3d23ff0983c36546511c9f912ce))
5523

56-
- add navigationBarColor prop to support animated navigation bar background ([df2253e](https://github.com/lukailun/react-native-animated-header-flat-list/commit/df2253e8b27d9efcb0c7fabba334ab8ef6c72375))
24+
## <small>1.4.1 (2025-03-19)</small>
5725

58-
## [1.2.3](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.2...v1.2.3) (2024-12-06)
26+
* fix: add eslint disable comment to metro config ([64f5123](https://github.com/lukailun/react-native-animated-header-flat-list/commit/64f512362359043fab1fb03120664e45b16d763d))
27+
* fix: convert babel config to commonjs ([4df90d8](https://github.com/lukailun/react-native-animated-header-flat-list/commit/4df90d86d4634b18433384699ff28ee25adba413))
5928

60-
### Bug Fixes
29+
## <small>1.4.0 (2025-03-10)</small>
6130

62-
- remove redundant interpolation input range value ([fa99989](https://github.com/lukailun/react-native-animated-header-flat-list/commit/fa9998983ae4d2448fa60cb4a3318434753e812d))
31+
* fix: use any type for navigation prop temporarily ([ef8c9b4](https://github.com/lukailun/react-native-animated-header-flat-list/commit/ef8c9b48c16a8beffd664e375c47576d5bb52cd0))
6332

64-
## [1.2.2](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.1...v1.2.2) (2024-11-28)
33+
## <small>1.3.1 (2025-01-21)</small>
6534

66-
### Bug Fixes
35+
* fix: change navigation prop type to any ([33377cf](https://github.com/lukailun/react-native-animated-header-flat-list/commit/33377cfcbfd3822a118752a7e6963b646bf3b15c))
36+
* fix: update navigation type ([889d916](https://github.com/lukailun/react-native-animated-header-flat-list/commit/889d91616cad6a1aac7134f79a7307a22800b65c))
6737

68-
- remove empty item ([26f970a](https://github.com/lukailun/react-native-animated-header-flat-list/commit/26f970aa1dfeb75f1e142db7d5e0a42482e6c402))
38+
## <small>1.3.0 (2025-01-21)</small>
6939

70-
## [1.2.1](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.0...v1.2.1) (2024-11-28)
40+
* feat: add navigationBarColor prop to support animated navigation bar background ([df2253e](https://github.com/lukailun/react-native-animated-header-flat-list/commit/df2253e8b27d9efcb0c7fabba334ab8ef6c72375))
7141

72-
### Bug Fixes
42+
## <small>1.2.3 (2024-12-06)</small>
7343

74-
- show header item in empty list ([824a6ab](https://github.com/lukailun/react-native-animated-header-flat-list/commit/824a6ab5258a07b2af0658b338c6876be416b0c6))
44+
* fix: remove redundant interpolation input range value ([fa99989](https://github.com/lukailun/react-native-animated-header-flat-list/commit/fa9998983ae4d2448fa60cb4a3318434753e812d))
7545

76-
# [1.2.0](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.1.1...v1.2.0) (2024-11-28)
46+
## <small>1.2.2 (2024-11-28)</small>
7747

78-
### Bug Fixes
48+
* fix: remove empty item ([26f970a](https://github.com/lukailun/react-native-animated-header-flat-list/commit/26f970aa1dfeb75f1e142db7d5e0a42482e6c402))
7949

80-
- remove stickyHeaderHiddenOnScroll ([170fcd7](https://github.com/lukailun/react-native-animated-header-flat-list/commit/170fcd7317a29bdf7a2598d29ae7fcc843fccb67))
50+
## <small>1.2.1 (2024-11-28)</small>
8151

82-
### Features
52+
* fix: show header item in empty list ([824a6ab](https://github.com/lukailun/react-native-animated-header-flat-list/commit/824a6ab5258a07b2af0658b338c6876be416b0c6))
8353

84-
- add parallax prop to control header background parallax effect ([9fa1b09](https://github.com/lukailun/react-native-animated-header-flat-list/commit/9fa1b09e603b766d7d2cc8a7706c1b5b6ef2b120))
85-
- add transparent status bar ([61714a8](https://github.com/lukailun/react-native-animated-header-flat-list/commit/61714a8050d51715f5fdcbcff996c2c1fa9e69f9))
54+
## <small>1.2.0 (2024-11-28)</small>
8655

87-
## [1.1.1](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.1.0...v1.1.1) (2024-11-27)
56+
* fix: remove stickyHeaderHiddenOnScroll ([170fcd7](https://github.com/lukailun/react-native-animated-header-flat-list/commit/170fcd7317a29bdf7a2598d29ae7fcc843fccb67))
57+
* feat: add parallax prop to control header background parallax effect ([9fa1b09](https://github.com/lukailun/react-native-animated-header-flat-list/commit/9fa1b09e603b766d7d2cc8a7706c1b5b6ef2b120))
58+
* feat: add transparent status bar ([61714a8](https://github.com/lukailun/react-native-animated-header-flat-list/commit/61714a8050d51715f5fdcbcff996c2c1fa9e69f9))

README.md

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,54 +54,37 @@ Make sure to follow the installation instructions for each dependency:
5454
- [React Native Reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started)
5555
- [React Native Safe Area Context](https://github.com/th3rdwave/react-native-safe-area-context#getting-started)
5656

57-
### Additional Setup
58-
59-
For React Native Reanimated, Add `react-native-reanimated/plugin` plugin to your `babel.config.js`.
60-
61-
```js
62-
module.exports = {
63-
presets: [
64-
... // don't add it here :)
65-
],
66-
plugins: [
67-
...
68-
'react-native-reanimated/plugin',
69-
],
70-
};
71-
```
72-
73-
CAUTION: `react-native-reanimated/plugin` has to be listed last.
74-
7557
## Usage
7658

7759
```tsx
78-
import { useNavigation } from '@react-navigation/native';
60+
import { useCallback } from 'react';
7961
import { Image, ImageBackground, StyleSheet, Text, View } from 'react-native';
8062
import { AnimatedHeaderFlatList } from 'react-native-animated-header-flat-list';
8163

8264
export default function HomeScreen() {
83-
const navigation = useNavigation();
8465
const data = Array.from({ length: 50 }, (_, index) => ({
8566
id: `item-${index}`,
8667
title: `Item ${index + 1}`,
8768
description: 'Lorem ipsum dolor sit amet',
8869
}));
8970
const title = 'Animated Title';
9071

91-
const renderItem = ({
92-
item,
93-
}: {
94-
item: { id: string; title: string; description: string };
95-
}) => (
96-
<View style={styles.listItem}>
97-
<Text style={styles.itemTitle}>{item.title}</Text>
98-
<Text style={styles.itemDescription}>{item.description}</Text>
99-
</View>
72+
const renderItem = useCallback(
73+
({
74+
item,
75+
}: {
76+
item: { id: string; title: string; description: string };
77+
}) => (
78+
<View style={styles.listItem}>
79+
<Text style={styles.itemTitle}>{item.title}</Text>
80+
<Text style={styles.itemDescription}>{item.description}</Text>
81+
</View>
82+
),
83+
[]
10084
);
10185

10286
return (
10387
<AnimatedHeaderFlatList
104-
navigation={navigation}
10588
title={title}
10689
headerTitleStyle={styles.headerTitle}
10790
navigationTitleStyle={styles.navigationTitle}
@@ -202,7 +185,6 @@ const styles = StyleSheet.create({
202185

203186
| Prop | Type | Required | Description |
204187
| --------------------------- | -------------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
205-
| `navigation` | any | Yes | React Navigation navigation prop |
206188
| `title` | string | Yes | The title text that will animate between header and navigation bar |
207189
| `headerTitleStyle` | StyleProp<TextStyle> | No | Style object for the title in the header. Supports all Text style props. Position is relative to header container |
208190
| `navigationTitleStyle` | StyleProp<TextStyle> | No | Style object for the title in the navigation bar. Supports all Text style props except position-related properties |

README_zh.md

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,54 +54,37 @@ npm install @react-navigation/native @react-navigation/native-stack @react-navig
5454
- [React Native Reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started)
5555
- [React Native Safe Area Context](https://github.com/th3rdwave/react-native-safe-area-context#getting-started)
5656

57-
### 额外配置
58-
59-
对于 React Native Reanimated,需要在 `babel.config.js` 中添加 `react-native-reanimated/plugin` 插件:
60-
61-
```js
62-
module.exports = {
63-
presets: [
64-
... // 不要加在这里 :)
65-
],
66-
plugins: [
67-
...
68-
'react-native-reanimated/plugin',
69-
],
70-
};
71-
```
72-
73-
注意:`react-native-reanimated/plugin` 必须放在插件列表的最后面。
74-
7557
## 使用示例
7658

7759
```tsx
78-
import { useNavigation } from '@react-navigation/native';
60+
import { useCallback } from 'react';
7961
import { Image, ImageBackground, StyleSheet, Text, View } from 'react-native';
8062
import { AnimatedHeaderFlatList } from 'react-native-animated-header-flat-list';
8163

8264
export default function HomeScreen() {
83-
const navigation = useNavigation();
8465
const data = Array.from({ length: 50 }, (_, index) => ({
8566
id: `item-${index}`,
8667
title: `Item ${index + 1}`,
8768
description: 'Lorem ipsum dolor sit amet',
8869
}));
8970
const title = 'Animated Title';
9071

91-
const renderItem = ({
92-
item,
93-
}: {
94-
item: { id: string; title: string; description: string };
95-
}) => (
96-
<View style={styles.listItem}>
97-
<Text style={styles.itemTitle}>{item.title}</Text>
98-
<Text style={styles.itemDescription}>{item.description}</Text>
99-
</View>
72+
const renderItem = useCallback(
73+
({
74+
item,
75+
}: {
76+
item: { id: string; title: string; description: string };
77+
}) => (
78+
<View style={styles.listItem}>
79+
<Text style={styles.itemTitle}>{item.title}</Text>
80+
<Text style={styles.itemDescription}>{item.description}</Text>
81+
</View>
82+
),
83+
[]
10084
);
10185

10286
return (
10387
<AnimatedHeaderFlatList
104-
navigation={navigation}
10588
title={title}
10689
headerTitleStyle={styles.headerTitle}
10790
navigationTitleStyle={styles.navigationTitle}
@@ -202,7 +185,6 @@ const styles = StyleSheet.create({
202185

203186
| 属性 | 类型 | 是否必需 | 描述 |
204187
| --------------------------- | -------------------- | -------- | ---------------------------------------------------------------------------- |
205-
| `navigation` | any || React Navigation 导航属性 |
206188
| `title` | string || 在 Header 和 NavigationBar 之间动画过渡的标题文本 |
207189
| `headerTitleStyle` | StyleProp<TextStyle> || Header 标题的样式对象。支持所有 Text 样式属性。位置相对于 HeaderContent |
208190
| `navigationTitleStyle` | StyleProp<TextStyle> || NavigationBar 标题的样式对象。支持除位置相关属性外的所有 Text 样式属性 |

example/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010
},
1111
"dependencies": {
1212
"@expo/metro-runtime": "~4.0.1",
13-
"@react-navigation/elements": "2.3.8",
14-
"@react-navigation/native": "7.1.6",
15-
"@react-navigation/native-stack": "7.3.10",
13+
"@react-navigation/elements": "2.4.3",
14+
"@react-navigation/native": "7.1.10",
15+
"@react-navigation/native-stack": "7.3.14",
1616
"expo": "~52.0.46",
17-
"expo-status-bar": "~2.0.1",
17+
"expo-status-bar": "^2.2.3",
1818
"react": "18.3.1",
1919
"react-dom": "18.3.1",
2020
"react-native": "0.76.9",
2121
"react-native-reanimated": "3.16.7",
22-
"react-native-safe-area-context": "5.4.0",
23-
"react-native-screens": "4.10.0",
24-
"react-native-web": "~0.19.13"
22+
"react-native-safe-area-context": "5.4.1",
23+
"react-native-screens": "4.11.1",
24+
"react-native-web": "^0.20.0"
2525
},
2626
"devDependencies": {
27-
"@babel/core": "^7.20.0",
28-
"react-native-builder-bob": "^0.40.5"
27+
"@babel/core": "^7.27.4",
28+
"react-native-builder-bob": "^0.40.11"
2929
},
3030
"private": true
3131
}

example/src/HomeScreen.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
import { useNavigation } from '@react-navigation/native';
1+
import { useCallback } from 'react';
22
import { Image, ImageBackground, StyleSheet, Text, View } from 'react-native';
33
import { AnimatedHeaderFlatList } from 'react-native-animated-header-flat-list';
44

55
export default function HomeScreen() {
6-
const navigation = useNavigation();
76
const data = Array.from({ length: 50 }, (_, index) => ({
87
id: `item-${index}`,
98
title: `Item ${index + 1}`,
109
description: 'Lorem ipsum dolor sit amet',
1110
}));
1211
const title = 'Animated Title';
1312

14-
const renderItem = ({
15-
item,
16-
}: {
17-
item: { id: string; title: string; description: string };
18-
}) => (
19-
<View style={styles.listItem}>
20-
<Text style={styles.itemTitle}>{item.title}</Text>
21-
<Text style={styles.itemDescription}>{item.description}</Text>
22-
</View>
13+
const renderItem = useCallback(
14+
({
15+
item,
16+
}: {
17+
item: { id: string; title: string; description: string };
18+
}) => (
19+
<View style={styles.listItem}>
20+
<Text style={styles.itemTitle}>{item.title}</Text>
21+
<Text style={styles.itemDescription}>{item.description}</Text>
22+
</View>
23+
),
24+
[]
2325
);
2426

2527
return (
2628
<AnimatedHeaderFlatList
27-
navigation={navigation}
2829
title={title}
2930
headerTitleStyle={styles.headerTitle}
3031
navigationTitleStyle={styles.navigationTitle}

0 commit comments

Comments
 (0)