[examples] Fix TypeScript error in ionic react example (#10985)

The ionic react build currently fails with:
```
$ react-scripts build
09:06:23.084 | Creating an optimized production build...
09:06:45.231 | Failed to compile.
09:06:45.231 |  
09:06:45.232 | /vercel/path0/node_modules/@types/babel__traverse/index.d.ts
09:06:45.232 | TypeScript error in /vercel/path0/node_modules/@types/babel__traverse/index.d.ts(314,13):
09:06:45.232 | Type expected.  TS1110
09:06:45.232 |  
09:06:45.232 | 312 \|         // too complex for TS. So we type it as a general visitor only if the key contains `\|`
09:06:45.232 | 313 \|         // this is good enough for non-visitor traverse options e.g. `noScope`
09:06:45.232 | > 314 \|         [k: `${string}\|${string}`]: VisitNode<S, Node>;
09:06:45.232 | \|             ^
09:06:45.232 | 315 \|     };
09:06:45.232 | 316 \|
09:06:45.232 | 317 \| export type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> \| VisitNodeObject<S, P>;
09:06:45.232
```

Upgrading to TypeScript 4 fixes the issue.

---------

Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
This commit is contained in:
Luc Leray
2023-12-21 20:04:26 +01:00
committed by GitHub
parent 5e3c077b6b
commit 04f5f3f3d2
3 changed files with 7 additions and 5 deletions

View File

@@ -23,7 +23,7 @@
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0",
"typescript": "3.8.3"
"typescript": "4.9.5"
},
"scripts": {
"start": "react-scripts start",

View File

@@ -11105,10 +11105,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
typescript@3.8.3:
version "3.8.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
typescript@4.9.5:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
uglify-js@3.4.x:
version "3.4.10"