Skip to content

Commit d3ae134

Browse files
committed
update react to version 18
1 parent 9e34df6 commit d3ae134

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
},
4949
"devDependencies": {
5050
"@testing-library/jest-dom": "^5.16.4",
51-
"@testing-library/react": "^12.0.0",
52-
"@testing-library/react-hooks": "^8.0.1",
51+
"@testing-library/react": "^13.4.0",
5352
"@types/css-mediaquery": "^0.1.1",
5453
"@types/jest": "^28.1.3",
55-
"@types/react": "^17.0.0",
54+
"@types/react": "^18.0.0",
55+
"@types/react-dom": "^18.0.0",
5656
"@typescript-eslint/eslint-plugin": "^5.30.0",
5757
"@typescript-eslint/parser": "^5.30.0",
5858
"css-mediaquery": "^0.1.2",
@@ -64,12 +64,12 @@
6464
"jest": "^28.1.1",
6565
"jest-environment-jsdom": "^28.1.1",
6666
"prettier": "^2.7.1",
67-
"react": "^17.0.2",
68-
"react-dom": "^17.0.2",
67+
"react": "^18.0.0",
68+
"react-dom": "^18.0.0",
6969
"ts-jest": "^28.0.5",
7070
"typescript": "^4.7.4"
7171
},
7272
"peerDependencies": {
73-
"react": "^16.0.0 || ^17.0.0"
73+
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
7474
}
7575
}

src/async-data/AsyncView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ const AsyncView = <Data, Error>(
3939
<>{renderSuccess}</>
4040
)
4141
case AsyncState.FINISHED_WITH_ERROR:
42-
return isFunction(renderError) ? renderError(error) : <>{renderError}</>
42+
return isFunction(renderError) ? (
43+
renderError(error as Error)
44+
) : (
45+
<>{renderError}</>
46+
)
4347
}
4448
}
4549

src/location-provider/LocationProvider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const LocationContext = createContext<LocationContextValue>({
1414
export const LocationProvider: React.FC<{
1515
highAccuracy: boolean
1616
delay: number
17+
children?: React.ReactNode
1718
}> = ({ highAccuracy, delay, children }) => {
1819
const [location, setLocation] = useState<LocationContextValue>({
1920
location: null,

0 commit comments

Comments
 (0)