Skip to content

Commit cd67e67

Browse files
committed
fix: 锁定react依赖版本 & 升级ahooks 至 3.7.6
1 parent b756aac commit cd67e67

File tree

12 files changed

+48
-59
lines changed

12 files changed

+48
-59
lines changed

example/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint": "eslint ."
1111
},
1212
"dependencies": {
13-
"react": "18.2.0",
13+
"react": "18.0.0",
1414
"react-native": "0.69.7",
1515
"@uiw/react-native": "3.2.3",
1616
"@uiw/react-native-image-picker": "3.2.3",

example/examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@react-navigation/native": "~6.0.11",
1515
"@react-navigation/stack": "~6.2.2",
1616
"@uiw/react-native": "3.2.3",
17-
"react": "18.2.0",
17+
"react": "18.0.0",
1818
"react-native": "0.69.7",
1919
"react-native-gesture-handler": "~2.5.0",
2020
"react-native-safe-area-context": "~4.3.1",

example/examples/src/routes.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,6 @@ export const stackPageData: Routes[] = [
362362
description: 'TransitionImage 图片过渡',
363363
},
364364
},
365-
// {
366-
// name: 'Card',
367-
// component: require('./routes/Card').default,
368-
// params: {
369-
// title: 'Card 卡片',
370-
// description: 'QuickList 最基础的卡片容器,可承载文字、列表、图片、段落。',
371-
// },
372-
// },
373365
{
374366
name: 'Progress',
375367
component: require('./routes/Progress').default,

package.json

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@
44
"scripts": {
55
"prepare": "husky install && cd ./test-ci && yarn install",
66
"⬇️⬇️⬇️⬇️⬇️ example::examples ⬇️⬇️⬇️⬇️⬇️": "▼▼▼▼▼ example::examples ▼▼▼▼▼",
7-
"lib:build:examples": "lerna exec --scope @uiw/react-native -- tsbb build src/*.{ts,tsx} --use-babel --cjs ../../example/examples/lib",
8-
"lib:watch:examples": "lerna exec --scope @uiw/react-native -- tsbb watch src/*.{ts,tsx} --use-babel --cjs ../../example/examples/lib",
7+
"lib:build:examples": "lerna exec --scope @uiw/react-native -- tsbb build --disable-babel-option --no-esm --cjs ../../example/examples/lib",
8+
"lib:watch:examples": "lerna exec --scope @uiw/react-native -- tsbb watch --disable-babel-option --no-esm --cjs ../../example/examples/lib",
99
"⬆️⬆️⬆️⬆️⬆️ example::examples ⬆️⬆️⬆️⬆️⬆️": "▲▲▲▲▲ example::examples ▲▲▲▲▲",
1010
"⬇️⬇️⬇️⬇️⬇️ doc ⬇️⬇️⬇️⬇️⬇️": "▼▼▼▼▼ example::examples ▼▼▼▼▼",
11-
"build:doc": "lerna exec --scope @uiw/react-native -- tsbb build src/*.{ts,tsx} --use-babel --cjs ../../website/src/react-native/lib",
12-
"watch:doc": "lerna exec --scope @uiw/react-native -- tsbb watch src/*.{ts,tsx} --use-babel --cjs ../../website/src/react-native/lib",
13-
"watch:doc1": "lerna exec --scope @uiw/react-native -- tsbb watch src/*.{ts,tsx} --use-babel --cjs ../../website/lib",
11+
"build:doc": "lerna exec --scope @uiw/react-native -- tsbb build --disable-babel-option --no-esm --cjs ../../website/src/react-native/lib",
12+
"watch:doc": "lerna exec --scope @uiw/react-native -- tsbb watch --disable-babel-option --no-esm --cjs ../../website/src/react-native/lib",
13+
"watch:doc1": "lerna exec --scope @uiw/react-native -- tsbb watch --disable-babel-option --no-esm --cjs ../../website/lib",
1414
"⬆️⬆️⬆️⬆️⬆️ doc ⬆️⬆️⬆️⬆️⬆️": "▲▲▲▲▲ example::examples ▲▲▲▲▲",
1515
"⬇️⬇️⬇️⬇️⬇️ example::base ⬇️⬇️⬇️⬇️⬇️": "▼▼▼▼▼ example::base ▼▼▼▼▼",
16-
"lib:build:base": "lerna exec --scope @uiw/react-native -- tsbb build src/*.{ts,tsx} --use-babel --cjs ../../example/base/lib",
17-
"lib:watch:base": "lerna exec --scope @uiw/react-native -- tsbb watch src/*.{ts,tsx} --use-babel --cjs ../../example/base/lib",
16+
"lib:build:base": "lerna exec --scope @uiw/react-native -- tsbb build --disable-babel-option --no-esm --cjs ../../example/base/lib",
17+
"lib:watch:base": "lerna exec --scope @uiw/react-native -- tsbb watch --disable-babel-option --no-esm --cjs ../../example/base/lib",
1818
"⬆️⬆️⬆️⬆️⬆️ example::base ⬆️⬆️⬆️⬆️⬆️": "▲▲▲▲▲ example::base ▲▲▲▲▲",
1919
"⬇️⬇️⬇️⬇️⬇️ test-ci ⬇️⬇️⬇️⬇️⬇️": "▼▼▼▼▼ example::base ▼▼▼▼▼",
20-
"lib:build:test": "lerna exec --scope @uiw/react-native -- tsbb build src/*.{ts,tsx} --use-babel --cjs ../../test-ci/src/lib",
21-
"lib:watch:test": "lerna exec --scope @uiw/react-native -- tsbb watch src/*.{ts,tsx} --use-babel --cjs ../../test-ci/src/lib",
20+
"lib:build:test": "lerna exec --scope @uiw/react-native -- tsbb build --disable-babel-option --no-esm --cjs ../../test-ci/src/lib",
21+
"lib:watch:test": "lerna exec --scope @uiw/react-native -- tsbb watch --disable-babel-option --no-esm --cjs ../../test-ci/src/lib",
2222
"test": "cd ./test-ci && npm run test",
2323
"⬆️⬆️⬆️⬆️⬆️ test-ci ⬆️⬆️⬆️⬆️⬆️": "▲▲▲▲▲ example::base ▲▲▲▲▲",
2424
"watch": "npm run lib:watch & npm run lib:watch:base & npm run lib:watch:examples & npm run lib:watch:test && npm run watch:doc & npm run lib:watch:image-picker & npm run lib:watch:examples:image-picker & npm run lib:watch:base:image-picker",
25-
"build": "npm run lib:build && npm run lib:build:base && npm run lib:build:examples && npm run lib:build:test && npm run build:doc && npm run lib:build:image-picker && npm run lib:build:examples:image-picker && npm run lib:build:base:image-picker",
25+
"build": "npm run lib:build && npm run lib:build:base && npm run lib:build:examples && npm run lib:build:test && npm run build:doc & npm run lib:build:image-picker & npm run lib:build:examples:image-picker & npm run lib:build:base:image-picker",
2626
">>>>>>>": ">>>>>>>",
27-
"lib:build": "lerna exec --scope @uiw/react-native -- tsbb build src/*.{ts,tsx} --use-babel",
28-
"lib:watch": "lerna exec --scope @uiw/react-native -- tsbb watch src/*.{ts,tsx} --use-babel",
27+
"lib:build": "lerna exec --scope @uiw/react-native -- tsbb build --disable-babel-option --no-esm",
28+
"lib:watch": "lerna exec --scope @uiw/react-native -- tsbb watch --disable-babel-option --no-esm",
2929
"⬇️⬇️⬇️⬇️⬇️ image-picker ⬇️⬇️⬇️⬇️⬇️": "▼▼▼▼▼ example::base ▼▼▼▼▼",
30-
"lib:build:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb build src/*.{ts,tsx} --use-babel",
31-
"lib:watch:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb watch src/*.{ts,tsx} --use-babel",
32-
"lib:build:examples:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb build src/*.{ts,tsx} --use-babel --cjs ../../example/examples/lib2",
33-
"lib:watch:examples:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb watch src/*.{ts,tsx} --use-babel --cjs ../../example/examples/lib2",
34-
"lib:build:base:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb build src/*.{ts,tsx} --use-babel --cjs ../../example/base/lib2",
35-
"lib:watch:base:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb watch src/*.{ts,tsx} --use-babel --cjs ../../example/base/lib2",
30+
"lib:build:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb build --disable-babel-option --no-esm",
31+
"lib:watch:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb watch --disable-babel-option --no-esm",
32+
"lib:build:examples:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb build --disable-babel-option --no-esm --cjs ../../example/examples/lib2",
33+
"lib:watch:examples:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb watch --disable-babel-option --no-esm --cjs ../../example/examples/lib2",
34+
"lib:build:base:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb build --disable-babel-option --no-esm --cjs ../../example/base/lib2",
35+
"lib:watch:base:image-picker": "lerna exec --scope @uiw/react-native-image-picker -- tsbb watch --disable-babel-option --no-esm --cjs ../../example/base/lib2",
3636
"⬆️⬆️⬆️⬆️⬆️ image-picker ⬆️⬆️⬆️⬆️⬆️": "▲▲▲▲▲ example::base ▲▲▲▲▲",
3737
"start": "lerna exec --scope website -- npm run start",
3838
"doc": "lerna exec --scope website -- npm run build",
@@ -53,23 +53,20 @@
5353
"babel-preset-react-native": "4.0.1",
5454
"fs-extra": "~10.1.0",
5555
"metro-react-native-babel-preset": "0.73.6",
56-
"react": "18.2.0",
57-
"react-native": "0.69.7",
58-
"electron-to-chromium": "^1.4.365",
59-
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
60-
"@babel/plugin-transform-classes": "^7.21.0"
56+
"react": "18.0.0",
57+
"react-native": "0.69.7"
6158
},
6259
"dependencies": {
6360
"husky": "^8.0.1",
6461
"lerna": "^5.3.0",
6562
"prettier": "^2.7.1",
6663
"pretty-quick": "^3.1.3",
67-
"tsbb": "^4.1.5",
64+
"tsbb": "3.7.6",
6865
"typescript": "^4.7.4"
6966
},
7067
"resolutions": {
71-
"react":"~18.2.0",
72-
"react-dom": "~18.2.0"
68+
"react":"18.0.0",
69+
"react-dom": "18.0.0"
7370
},
7471
"workspaces": {
7572
"packages": [

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@types/react-native": "0.69.1",
5858
"@uiw/icons": "2.5.3",
5959
"@validator.tool/hook": "2.2.4",
60-
"ahooks": "2.10.14",
60+
"ahooks": "3.7.6",
6161
"dayjs":"~1.11.7",
6262
"color": "4.2.3",
6363
"lodash": "4.17.21",

packages/core/src/DatePicker/components/basic-date-picker/useDatePicker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo } from 'react';
2-
import { usePersistFn } from 'ahooks';
2+
import { useMemoizedFn } from 'ahooks';
33
import dayjs, { Dayjs } from 'dayjs';
44
import { ItemValue } from '../../../Picker/components/WheelPicker/type';
55
import { CascadePickerItemProps, DatePickerPropsBase } from './type';
@@ -320,8 +320,8 @@ export default function useDatePicker({
320320
};
321321

322322
return {
323-
getValueCols: usePersistFn(getValueCols),
324-
onValueChange: usePersistFn(onValueChange),
323+
getValueCols: useMemoizedFn(getValueCols),
324+
onValueChange: useMemoizedFn(onValueChange),
325325
};
326326
}
327327

packages/core/src/DatePicker/date-period-input/useDatePeriodInput.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useMemo } from 'react';
22
import { Keyboard } from 'react-native';
3-
import { useBoolean, useSafeState, usePersistFn } from 'ahooks';
3+
import { useBoolean, useSafeState, useMemoizedFn } from 'ahooks';
44
import { useLatest } from '../../utils/hooks';
55
import dayjs from 'dayjs';
66

@@ -90,11 +90,11 @@ export default function useDatePeriodInput({
9090
maxDate,
9191
clearIconStyle1,
9292
clearIconStyle2,
93-
setFalse: usePersistFn(setFalse),
94-
handleStartPress: usePersistFn(handleStartPress),
95-
handleEndPress: usePersistFn(handleEndPress),
96-
handleChange: usePersistFn(handleChange),
97-
handleInputClear1: usePersistFn(handleInputClear1),
98-
handleInputClear2: usePersistFn(handleInputClear2),
93+
setFalse: useMemoizedFn(setFalse),
94+
handleStartPress: useMemoizedFn(handleStartPress),
95+
handleEndPress: useMemoizedFn(handleEndPress),
96+
handleChange: useMemoizedFn(handleChange),
97+
handleInputClear1: useMemoizedFn(handleInputClear1),
98+
handleInputClear2: useMemoizedFn(handleInputClear2),
9999
};
100100
}

packages/core/src/DatePicker/date-picker/useDatePicker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect } from 'react';
22
import { BackHandler } from 'react-native';
3-
import { useSafeState, usePersistFn } from 'ahooks';
3+
import { useSafeState, useMemoizedFn } from 'ahooks';
44
import { useLatest } from '../../utils/hooks';
55
import dayjs from 'dayjs';
66
import { DatePickerPropsBase, ModalPickerProps } from '../components/basic-date-picker/type';
@@ -46,8 +46,8 @@ export default function useDatePicker({
4646

4747
return {
4848
date,
49-
handleChange: usePersistFn(handleChange),
50-
handleOk: usePersistFn(handleOk),
51-
handleClose: usePersistFn(handleClose),
49+
handleChange: useMemoizedFn(handleChange),
50+
handleOk: useMemoizedFn(handleOk),
51+
handleClose: useMemoizedFn(handleClose),
5252
};
5353
}

packages/core/src/utils/hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRef, useEffect } from 'react';
2-
import { usePersistFn, useUpdate } from 'ahooks';
2+
import { useMemoizedFn, useUpdate } from 'ahooks';
33

44
/**
55
* 获取上一轮的 props 或 state
@@ -38,7 +38,7 @@ export function usePropsValue<T>(options: Options<T>) {
3838
stateRef.current = value;
3939
}
4040

41-
const setState = usePersistFn((v: T) => {
41+
const setState = useMemoizedFn((v: T) => {
4242
if (value === undefined) {
4343
stateRef.current = v;
4444
update();

packages/react-native-image-picker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@types/react-native": "0.69.1",
2727
"prop-types": "15.7.2",
2828
"@uiw/icons": "2.5.3",
29-
"ahooks": "2.10.14",
29+
"ahooks": "3.7.6",
3030
"@shopify/restyle":"~2.4.2",
3131
"@uiw/react-native":"~3.2.3",
3232
"react-native-svg": "12.1.1",

0 commit comments

Comments
 (0)