Skip to content

Commit a5d2566

Browse files
authored
Migrate to React Hooks (#112)
* Compare with react compare * Fix tslint issues * Node changes * Fix node view * Fix node view hooks * Fix imports * Completed node view * Fix issue in node view * Converted NestedRow in a functional component * Converted to React Hooks * memo to avoid rerenders * Fix tslint issues * Fix tests * Remove unnecessary deps * Added codecov * Prettier config
1 parent 350e0e8 commit a5d2566

File tree

9 files changed

+1238
-1266
lines changed

9 files changed

+1238
-1266
lines changed

package.json

Lines changed: 91 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,96 @@
11
{
2-
"name": "react-native-nested-listview",
3-
"version": "0.7.1",
4-
"description": "Nested Listview for React native",
5-
"main": "./dist/index.js",
6-
"types": "./dist/index.d.ts",
7-
"scripts": {
8-
"test": "jest && codecov",
9-
"tslint": "tslint -p .",
10-
"type-check": "tsc --noEmit",
11-
"prepublishOnly": "tsc -p ./ --outDir dist/"
12-
},
13-
"repository": {
14-
"type": "git",
15-
"url": "git+https://github.com/fjmorant/react-native-nested-listview.git"
16-
},
17-
"dependencies": {
18-
"lodash.isequal": "4.5.0",
19-
"shortid": "2.2.14"
20-
},
21-
"peerDependencies": {
22-
"react": "16.9.0",
23-
"react-native": "~0.60.5"
24-
},
25-
"devDependencies": {
26-
"@babel/core": "7.5.5",
27-
"@babel/runtime": "7.5.5",
28-
"@types/jest": "24.0.17",
29-
"@types/lodash.isequal": "4.5.5",
30-
"@types/react": "16.9.2",
31-
"@types/react-native": "0.60.6",
32-
"@types/react-test-renderer": "16.9.0",
33-
"@types/shortid": "0.0.29",
34-
"babel-jest": "24.9.0",
35-
"flow-bin": "0.105.2",
36-
"istanbul": "0.4.5",
37-
"istanbul-api": "2.1.6",
38-
"istanbul-reports": "2.2.6",
39-
"jest": "24.9.0",
40-
"metro-react-native-babel-preset": "0.56.0",
41-
"prettier": "1.18.2",
42-
"prettier-eslint": "9.0.0",
43-
"react-test-renderer": "16.9.0",
44-
"ts-jest": "24.0.2",
45-
"tslint": "5.18.0",
46-
"typescript": "3.5.3"
47-
},
48-
"keywords": [
49-
"react",
50-
"native",
51-
"list",
52-
"nested"
53-
],
54-
"author": "Javier Morant",
55-
"license": "MIT",
56-
"bugs": {
57-
"url": "https://github.com/fjmorant/react-native-nested-listview/issues"
58-
},
59-
"homepage": "https://github.com/fjmorant/react-native-nested-listview#readme",
60-
"jest": {
61-
"preset": "react-native",
62-
"moduleFileExtensions": [
63-
"ts",
64-
"tsx",
65-
"js"
66-
],
67-
"transform": {
68-
"^.+\\.(js)$": "<rootDir>/node_modules/babel-jest",
69-
"\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
2+
"name": "react-native-nested-listview",
3+
"version": "0.7.1",
4+
"description": "Nested Listview for React native",
5+
"main": "./dist/index.js",
6+
"types": "./dist/index.d.ts",
7+
"scripts": {
8+
"test": "jest && codecov",
9+
"tslint": "tslint -p .",
10+
"type-check": "tsc --noEmit",
11+
"prepublishOnly": "tsc -p ./ --outDir dist/",
12+
"add-react": "yarn add react@16.9.0 && yarn add react-native@0.60.5",
13+
"remove-react": "yarn remove react && yarn remove react-native",
14+
"prettier-check": "prettier --check 'src/**/*.{ts, tsx}'",
15+
"prettier-format": "prettier --write 'src/**/*.{ts, tsx}'"
7016
},
71-
"transformIgnorePatterns": [
72-
"node_modules/(?!(jest-)|react-native|react-navigation|react-clone-referenced-element|mobx-react)"
73-
],
74-
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
75-
"modulePathIgnorePatterns": [
76-
"<rootDir>/examples/"
77-
],
78-
"testPathIgnorePatterns": [
79-
"\\.snap$",
80-
"<rootDir>/node_modules/",
81-
"<rootDir>/examples/",
82-
"<rootDir>/lib/",
83-
"<rootDir>/dist/"
17+
"repository": {
18+
"type": "git",
19+
"url": "git+https://github.com/fjmorant/react-native-nested-listview.git"
20+
},
21+
"dependencies": {
22+
"react-fast-compare": "2.0.4",
23+
"shortid": "2.2.14"
24+
},
25+
"peerDependencies": {
26+
"react": "16.9.0",
27+
"react-native": "~0.60.5"
28+
},
29+
"devDependencies": {
30+
"@babel/core": "7.5.5",
31+
"@babel/runtime": "7.5.5",
32+
"@types/jest": "24.0.17",
33+
"@types/react": "16.9.2",
34+
"@types/react-native": "0.60.8",
35+
"@types/react-test-renderer": "16.9.0",
36+
"@types/shortid": "0.0.29",
37+
"babel-jest": "24.9.0",
38+
"flow-bin": "0.105.2",
39+
"istanbul": "0.4.5",
40+
"istanbul-api": "2.1.6",
41+
"istanbul-reports": "2.2.6",
42+
"jest": "24.9.0",
43+
"metro-react-native-babel-preset": "0.56.0",
44+
"prettier": "1.18.2",
45+
"prettier-eslint": "9.0.0",
46+
"react-test-renderer": "16.9.0",
47+
"ts-jest": "24.0.2",
48+
"tslint": "5.19.0",
49+
"typescript": "3.5.3"
50+
},
51+
"keywords": [
52+
"react",
53+
"native",
54+
"list",
55+
"nested"
8456
],
85-
"coverageDirectory": "./coverage/",
86-
"collectCoverage": true,
87-
"globals": {
88-
"ts-jest": {
89-
"babelConfig": true
90-
}
57+
"author": "Javier Morant",
58+
"license": "MIT",
59+
"bugs": {
60+
"url": "https://github.com/fjmorant/react-native-nested-listview/issues"
61+
},
62+
"homepage": "https://github.com/fjmorant/react-native-nested-listview#readme",
63+
"jest": {
64+
"preset": "react-native",
65+
"moduleFileExtensions": [
66+
"ts",
67+
"tsx",
68+
"js"
69+
],
70+
"transform": {
71+
"^.+\\.(js)$": "<rootDir>/node_modules/babel-jest",
72+
"\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
73+
},
74+
"transformIgnorePatterns": [
75+
"node_modules/(?!(jest-)|react-native|react-navigation|react-clone-referenced-element|mobx-react)"
76+
],
77+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
78+
"modulePathIgnorePatterns": [
79+
"<rootDir>/examples/"
80+
],
81+
"testPathIgnorePatterns": [
82+
"\\.snap$",
83+
"<rootDir>/node_modules/",
84+
"<rootDir>/examples/",
85+
"<rootDir>/lib/",
86+
"<rootDir>/dist/"
87+
],
88+
"coverageDirectory": "./coverage/",
89+
"collectCoverage": true,
90+
"globals": {
91+
"ts-jest": {
92+
"babelConfig": true
93+
}
94+
}
9195
}
92-
}
9396
}

prettier.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
trailingComma: 'es5',
3+
tabWidth: 2,
4+
semi: false,
5+
singleQuote: true,
6+
bracketSpacing: false,
7+
}

0 commit comments

Comments
 (0)