Skip to content

Commit 8afc47e

Browse files
committed
Use require instead of dynamic import
1 parent d268580 commit 8afc47e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apps/test-app/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ function loadTests({
4444
});
4545

4646
describeIf(ferricExample, "ferric-example", () => {
47-
it("exports a callable sum function", async () => {
48-
const exampleAddon = await import("ferric-example");
47+
it("exports a callable sum function", () => {
48+
/* eslint-disable-next-line @typescript-eslint/no-require-imports -- TODO: Determine why a dynamic import doesn't work on Android */
49+
const exampleAddon = require("ferric-example");
4950
const result = exampleAddon.sum(1, 3);
5051
if (result !== 4) {
5152
throw new Error(`Expected 1 + 3 to equal 4, but got ${result}`);

packages/ferric-example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@react-native-node-api/ferric-example",
33
"private": true,
4+
"type": "commonjs",
45
"version": "0.1.0",
56
"homepage": "https://github.com/callstackincubator/react-native-node-api",
67
"repository": {

0 commit comments

Comments
 (0)