Skip to content

Commit 34408c3

Browse files
committed
Use require instead of dynamic import
1 parent 1a2536d commit 34408c3

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
@@ -47,8 +47,9 @@ function loadTests({
4747
});
4848

4949
describeIf(ferricExample, "ferric-example", () => {
50-
it("exports a callable sum function", async () => {
51-
const exampleAddon = await import("ferric-example");
50+
it("exports a callable sum function", () => {
51+
/* eslint-disable-next-line @typescript-eslint/no-require-imports -- TODO: Determine why a dynamic import doesn't work on Android */
52+
const exampleAddon = require("ferric-example");
5253
const result = exampleAddon.sum(1, 3);
5354
if (result !== 4) {
5455
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)