Skip to content

Commit 691cbee

Browse files
authored
Merge pull request #118 from JairajJangle/develop
Upgraded zustand to v5 and upgraded other deps
2 parents 740ab2d + 9d50f88 commit 691cbee

11 files changed

+3418
-2903
lines changed

example/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"react-native-gesture-handler": "2.17.1",
2222
"react-native-paper": "^5.13.1",
2323
"react-native-safe-area-context": "^4.7.1",
24-
"react-native-screens": "^3.22.1",
25-
"react-native-vector-icons": "^10.1.0"
24+
"react-native-screens": "3.35.0",
25+
"react-native-vector-icons": "^10.2.0"
2626
},
2727
"devDependencies": {
2828
"@babel/core": "^7.20.0",

example/yarn.lock

+229-223
Large diffs are not rendered by default.

package-lock.json

+1,850-1,642
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
3838
"build:ios": "cd example/ios && pod install && xcodebuild -workspace TreeMultiSelectExample.xcworkspace -scheme TreeMultiSelectExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
3939
"bootstrap": "yarn example && yarn install && yarn example pods",
40-
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
40+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
41+
"postinstall": "patch-package"
4142
},
4243
"keywords": [
4344
"react-native",
@@ -85,7 +86,7 @@
8586
"@commitlint/config-conventional": "^19.7.1",
8687
"@evilmartians/lefthook": "^1.10.10",
8788
"@react-native-community/eslint-config": "^3.2.0",
88-
"@release-it/conventional-changelog": "^8.0.2",
89+
"@release-it/conventional-changelog": "^10.0.0",
8990
"@semantic-release/changelog": "^6.0.3",
9091
"@semantic-release/git": "^10.0.1",
9192
"@semantic-release/github": "^11.0.1",
@@ -95,8 +96,8 @@
9596
"@testing-library/react-native": "^12.6.1",
9697
"@types/color": "^3.0.6",
9798
"@types/jest": "^29.5.3",
98-
"@types/lodash": "^4.17.13",
99-
"@types/react": "~17.0.21",
99+
"@types/lodash": "^4.17.16",
100+
"@types/react": "^18.0.24",
100101
"@types/react-native": "0.70.0",
101102
"@types/react-native-vector-icons": "^6.4.18",
102103
"@types/react-test-renderer": "18.3.0",
@@ -106,21 +107,19 @@
106107
"eslint-config-prettier": "^8.5.0",
107108
"eslint-plugin-prettier": "^4.0.0",
108109
"jest": "^29.7.0",
110+
"patch-package": "^8.0.0",
109111
"prettier": "^3.3.3",
110112
"react": "18.2.0",
111113
"react-native": "^0.72.15",
112114
"react-native-builder-bob": "^0.30.0",
113115
"react-native-paper": "5.x.x",
114116
"react-test-renderer": "18.2.0",
115-
"release-it": "^17.6.0",
117+
"release-it": "^18.1.2",
116118
"semantic-release": "^24.1.0",
117119
"ts-jest": "^29.1.1",
118120
"turbo": "^2.1.0",
119121
"typescript": "^5.0.2"
120122
},
121-
"resolutions": {
122-
"@types/react": "17.0.21"
123-
},
124123
"peerDependencies": {
125124
"@shopify/flash-list": "1.x.x",
126125
"react": "*",
@@ -211,7 +210,7 @@
211210
"dependencies": {
212211
"lodash": "^4.17.21",
213212
"react-native-uuid": "^2.0.3",
214-
"zustand": "^4.5.6"
213+
"zustand": "^5.0.3"
215214
},
216215
"funding": [
217216
{
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff --git a/node_modules/react-native-paper/src/utils/forwardRef.tsx b/node_modules/react-native-paper/src/utils/forwardRef.tsx
2+
index bca954b..0761712 100644
3+
--- a/node_modules/react-native-paper/src/utils/forwardRef.tsx
4+
+++ b/node_modules/react-native-paper/src/utils/forwardRef.tsx
5+
@@ -19,5 +19,5 @@ export type ForwardRefComponent<T, P = {}> = ForwardRefExoticComponent<
6+
* More info: https://github.com/callstack/react-native-paper/pull/3603
7+
*/
8+
export const forwardRef: <T, P = {}>(
9+
- render: ForwardRefRenderFunction<T, P>
10+
+ render: ForwardRefRenderFunction<T, PropsWithoutRef<P>>
11+
) => ForwardRefComponent<T, P> = React.forwardRef;

src/__mocks__/zustand.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { act } from '@testing-library/react-native';
2-
import { StateCreator } from 'zustand';
1+
import { act } from "@testing-library/react-native";
2+
import { StateCreator } from "zustand";
33

4-
const { create: actualCreate } = jest.requireActual('zustand');
4+
const { create: actualCreate } = jest.requireActual("zustand");
55

66
// a variable to hold reset functions for all stores declared in the app
77
const storeResetFns = new Set<() => void>();

src/__tests__/selectAll.helper.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
jest.mock('zustand');
2+
13
import { tree3d2b } from "../__mocks__/generateTree.mock";
24
import {
35
getFilteredTreeData,
@@ -12,8 +14,6 @@ import { getTreeViewStore } from "../store/treeView.store";
1214
import { act } from 'react-test-renderer';
1315
import { testStoreId } from "../constants/tests.constants";
1416

15-
jest.mock('zustand');
16-
1717
describe('selectAll helpers functions', () => {
1818
const useTreeViewStore = getTreeViewStore(testStoreId);
1919

src/components/NodeList.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
import { CheckboxView } from "./CheckboxView";
2626
import { CustomExpandCollapseIcon } from "./CustomExpandCollapseIcon";
2727
import { defaultIndentationMultiplier } from "../constants/treeView.constants";
28-
import { useShallow } from 'zustand/react/shallow';
28+
import { useShallow } from "zustand/react/shallow";
2929
import { typedMemo } from "../utils/typedMemo";
3030
import { ScrollToNodeHandler } from "../handlers/ScrollToNodeHandler";
3131

@@ -157,7 +157,7 @@ function getValue(
157157
isIndeterminate: boolean
158158
): CheckboxValueType {
159159
if (isIndeterminate) {
160-
return 'indeterminate';
160+
return "indeterminate";
161161
} else if (isChecked) {
162162
return true;
163163
} else {
@@ -249,8 +249,8 @@ const styles = StyleSheet.create({
249249
},
250250
nodeCheckboxAndArrowRow: {
251251
flex: 1,
252-
flexDirection: 'row',
253-
alignItems: 'center',
252+
flexDirection: "row",
253+
alignItems: "center",
254254
minWidth: "100%"
255255
}
256256
});

src/store/treeView.store.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { SelectionPropagation, TreeNode } from "src/types/treeView.types";
2-
import { create, StoreApi, UseBoundStore } from 'zustand';
2+
import { create, StoreApi, UseBoundStore } from "zustand";
33

44
export type TreeViewState<ID> = {
55
// Store ids of checked tree nodes

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"compilerOptions": {
66
"baseUrl": "./",
77
"paths": {
8-
"react-native-tree-multi-select": ["./src/index"]
8+
"react-native-tree-multi-select": ["./src/index"],
9+
"react": [ "./node_modules/@types/react" ]
910
},
1011
"allowUnreachableCode": false,
1112
"allowUnusedLabels": false,

0 commit comments

Comments
 (0)