-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add support for Expo web (#330)
- Loading branch information
1 parent
ea4a2b8
commit 34bc324
Showing
10 changed files
with
153 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"example": minor | ||
"victory-native": minor | ||
--- | ||
|
||
Added support for Expo web as a platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import "@expo/metro-runtime"; | ||
import { App } from "expo-router/build/qualified-entry"; | ||
import { renderRootComponent } from "expo-router/build/renderRootComponent"; | ||
|
||
// eslint-disable-next-line import/no-unresolved | ||
import { version } from "canvaskit-wasm/package.json"; | ||
|
||
import { LoadSkiaWeb } from "@shopify/react-native-skia/lib/module/web"; | ||
|
||
// When used on the web, we need to load the CanvasKit WASM file before rendering content | ||
// For simplicity, we are using a CDN to load the file, but it can be hosted on your own server as well | ||
// See https://shopify.github.io/react-native-skia/docs/getting-started/web for more details | ||
LoadSkiaWeb({ | ||
locateFile: (file) => | ||
`https://cdn.jsdelivr.net/npm/canvaskit-wasm@${version}/bin/full/${file}`, | ||
}).then(async () => { | ||
renderRootComponent(App); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.