Skip to content

Commit 55e2eec

Browse files
committed
refactor!: remove react hooks
1 parent 2bc01e5 commit 55e2eec

File tree

8 files changed

+6
-188
lines changed

8 files changed

+6
-188
lines changed

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -207,20 +207,6 @@ try {
207207
}
208208
```
209209

210-
### React Hooks Support
211-
212-
```js
213-
import { useGeocodeAddress, useGeocodePosition } from '@timwangdev/react-native-geocoder';
214-
```
215-
216-
* `useGeocodeAddress(address: string, options?: GeocoderOptions)`
217-
218-
Returns `{ result: GeocodingObject[], error: Error, loading: boolean }`
219-
220-
* `useGeocodePosition(position: { lat: number, lng: number }, options?: GeocoderOptions)`
221-
222-
Returns `{ result: GeocodingObject[], error: Error, loading: boolean }`
223-
224210
## License
225211

226212
MIT

example/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@react-native-community/geocoder-example",
3-
"description": "Example app for @react-native-community/geocoder",
2+
"name": "@timwangdev/react-native-geocoder-example",
3+
"description": "Example app for @timwangdev/react-native-geocoder-example.",
44
"version": "0.0.1",
55
"private": true,
66
"scripts": {
@@ -10,8 +10,7 @@
1010
},
1111
"dependencies": {
1212
"react": "16.11.0",
13-
"react-native": "0.62.2",
14-
"use-deep-compare-effect": "^1.3.1"
13+
"react-native": "0.62.2"
1514
},
1615
"devDependencies": {
1716
"@babel/core": "^7.8.4",

example/yarn.lock

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@
617617
pirates "^4.0.0"
618618
source-map-support "^0.5.16"
619619

620-
"@babel/runtime@^7.0.0", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4":
620+
"@babel/runtime@^7.0.0", "@babel/runtime@^7.8.4":
621621
version "7.9.2"
622622
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.2.tgz#d90df0583a3a252f09aaa619665367bae518db06"
623623
integrity sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==
@@ -874,31 +874,11 @@
874874
"@types/istanbul-lib-coverage" "*"
875875
"@types/istanbul-lib-report" "*"
876876

877-
"@types/prop-types@*":
878-
version "15.7.3"
879-
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
880-
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==
881-
882-
"@types/react@*":
883-
version "16.9.34"
884-
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.34.tgz#f7d5e331c468f53affed17a8a4d488cd44ea9349"
885-
integrity sha512-8AJlYMOfPe1KGLKyHpflCg5z46n0b5DbRfqDksxBLBTUpB75ypDBAO9eCUcjNwE6LCUslwTz00yyG/X9gaVtow==
886-
dependencies:
887-
"@types/prop-types" "*"
888-
csstype "^2.2.0"
889-
890877
"@types/stack-utils@^1.0.1":
891878
version "1.0.1"
892879
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
893880
integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
894881

895-
"@types/use-deep-compare-effect@^1.2.0":
896-
version "1.2.0"
897-
resolved "https://registry.yarnpkg.com/@types/use-deep-compare-effect/-/use-deep-compare-effect-1.2.0.tgz#d55d9bda6fea5ff7c93038c53052db1b3145f5d9"
898-
integrity sha512-2uNqaSobMvUTGR7G72tUHDX+Kx341q25OuM0m2B6VID7eljIvYuDaFTKfmDnbvej67yEhCc35zA6dmIYriwOXA==
899-
dependencies:
900-
"@types/react" "*"
901-
902882
"@types/yargs-parser@*":
903883
version "15.0.0"
904884
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d"
@@ -1571,11 +1551,6 @@ cross-spawn@^6.0.0:
15711551
shebang-command "^1.2.0"
15721552
which "^1.2.9"
15731553

1574-
csstype@^2.2.0:
1575-
version "2.6.10"
1576-
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.10.tgz#e63af50e66d7c266edb6b32909cfd0aabe03928b"
1577-
integrity sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w==
1578-
15791554
dayjs@^1.8.15:
15801555
version "1.8.25"
15811556
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.25.tgz#d09a8696cee7191bc1289e739f96626391b9c73c"
@@ -1656,11 +1631,6 @@ depd@~1.1.2:
16561631
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
16571632
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
16581633

1659-
dequal@^1.0.0:
1660-
version "1.0.0"
1661-
resolved "https://registry.yarnpkg.com/dequal/-/dequal-1.0.0.tgz#41c6065e70de738541c82cdbedea5292277a017e"
1662-
integrity sha512-/Nd1EQbQbI9UbSHrMiKZjFLrXSnU328iQdZKPQf78XQI6C+gutkFUeoHpG5J08Ioa6HeRbRNFpSIclh1xyG0mw==
1663-
16641634
destroy@~1.0.4:
16651635
version "1.0.4"
16661636
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
@@ -4163,15 +4133,6 @@ urix@^0.1.0:
41634133
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
41644134
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
41654135

4166-
use-deep-compare-effect@^1.3.1:
4167-
version "1.3.1"
4168-
resolved "https://registry.yarnpkg.com/use-deep-compare-effect/-/use-deep-compare-effect-1.3.1.tgz#90bdbed97e1acb8423f7bb0bf24de58590d021af"
4169-
integrity sha512-ejL+Al+aeDyC9Sywx56ti4PtSwkf6BH27tEptMWF2cfO41/auG0nRRsArh6Vv5bUyBe3z7IyxmgQCK5nas70hg==
4170-
dependencies:
4171-
"@babel/runtime" "^7.7.2"
4172-
"@types/use-deep-compare-effect" "^1.2.0"
4173-
dequal "^1.0.0"
4174-
41754136
use-subscription@^1.0.0:
41764137
version "1.4.1"
41774138
resolved "https://registry.yarnpkg.com/use-subscription/-/use-subscription-1.4.1.tgz#edcbcc220f1adb2dd4fa0b2f61b6cc308e620069"

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
"url": "https://github.com/timwangdev/react-native-geocoder-reborn/issues"
3636
},
3737
"homepage": "https://github.com/timwangdev/react-native-geocoder-reborn#readme",
38-
"dependencies": {
39-
"use-deep-compare-effect": "^1.3.1"
40-
},
38+
"dependencies": {},
4139
"devDependencies": {
4240
"@commitlint/config-conventional": "^8.3.4",
4341
"@react-native-community/bob": "^0.10.0",

src/__tests__/hooks.test.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/hooks.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import geocoder from './geocoder';
2-
import { useGeocodePosition, useGeocodeAddress } from './hooks';
32
import {
43
Position,
54
Bounds,
@@ -9,5 +8,4 @@ import {
98
} from './types';
109

1110
export { Position, Bounds, CircularRegion, GeocoderOptions, GeocodingObject };
12-
export { useGeocodePosition, useGeocodeAddress };
1311
export default geocoder;

yarn.lock

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@
927927
core-js-pure "^3.0.0"
928928
regenerator-runtime "^0.13.4"
929929

930-
"@babel/runtime@^7.0.0", "@babel/runtime@^7.5.4", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
930+
"@babel/runtime@^7.0.0", "@babel/runtime@^7.5.4", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
931931
version "7.9.2"
932932
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.2.tgz#d90df0583a3a252f09aaa619665367bae518db06"
933933
integrity sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==
@@ -1946,13 +1946,6 @@
19461946
"@types/react" "*"
19471947
"@types/react-test-renderer" "*"
19481948

1949-
"@types/use-deep-compare-effect@^1.2.0":
1950-
version "1.2.0"
1951-
resolved "https://registry.yarnpkg.com/@types/use-deep-compare-effect/-/use-deep-compare-effect-1.2.0.tgz#d55d9bda6fea5ff7c93038c53052db1b3145f5d9"
1952-
integrity sha512-2uNqaSobMvUTGR7G72tUHDX+Kx341q25OuM0m2B6VID7eljIvYuDaFTKfmDnbvej67yEhCc35zA6dmIYriwOXA==
1953-
dependencies:
1954-
"@types/react" "*"
1955-
19561949
"@types/yargs-parser@*":
19571950
version "15.0.0"
19581951
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d"
@@ -3608,11 +3601,6 @@ deprecation@^2.0.0, deprecation@^2.3.1:
36083601
resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919"
36093602
integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==
36103603

3611-
dequal@^1.0.0:
3612-
version "1.0.0"
3613-
resolved "https://registry.yarnpkg.com/dequal/-/dequal-1.0.0.tgz#41c6065e70de738541c82cdbedea5292277a017e"
3614-
integrity sha512-/Nd1EQbQbI9UbSHrMiKZjFLrXSnU328iQdZKPQf78XQI6C+gutkFUeoHpG5J08Ioa6HeRbRNFpSIclh1xyG0mw==
3615-
36163604
destroy@~1.0.4:
36173605
version "1.0.4"
36183606
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
@@ -9473,15 +9461,6 @@ url-parse-lax@^3.0.0:
94739461
dependencies:
94749462
prepend-http "^2.0.0"
94759463

9476-
use-deep-compare-effect@^1.3.1:
9477-
version "1.3.1"
9478-
resolved "https://registry.yarnpkg.com/use-deep-compare-effect/-/use-deep-compare-effect-1.3.1.tgz#90bdbed97e1acb8423f7bb0bf24de58590d021af"
9479-
integrity sha512-ejL+Al+aeDyC9Sywx56ti4PtSwkf6BH27tEptMWF2cfO41/auG0nRRsArh6Vv5bUyBe3z7IyxmgQCK5nas70hg==
9480-
dependencies:
9481-
"@babel/runtime" "^7.7.2"
9482-
"@types/use-deep-compare-effect" "^1.2.0"
9483-
dequal "^1.0.0"
9484-
94859464
use-subscription@^1.0.0:
94869465
version "1.4.1"
94879466
resolved "https://registry.yarnpkg.com/use-subscription/-/use-subscription-1.4.1.tgz#edcbcc220f1adb2dd4fa0b2f61b6cc308e620069"

0 commit comments

Comments
 (0)