From 8e865a9bdbbeb3b6b6607190d6023e405bcacf23 Mon Sep 17 00:00:00 2001 From: Jakub Grzywacz Date: Fri, 25 Oct 2024 19:59:44 +0200 Subject: [PATCH] fix: create symlink to common directory (#2512) # Summary After changing project structure, local images stopped displaying on Android. This is due to the fact that React Native on Android uses okhttp for requests, which modifies the endpoint "by cleaning up the wrong part" from `http://10.0.2.2:8081/../common/example/assets/image.jpg` to `http://10.0.2.2:8081/common/example/assets/image.jpg` A quick fix for this is to create a symlink to the common directory, allowing images to be resolved without the `../` segment. Special thanks to Kudo for sharing the original workaround here: https://github.com/facebook/metro/issues/322#issuecomment-445642199. --- apps/fabric-example/common | 1 + apps/paper-example/common | 1 + apps/tests-example/common | 1 + 3 files changed, 3 insertions(+) create mode 120000 apps/fabric-example/common create mode 120000 apps/paper-example/common create mode 120000 apps/tests-example/common diff --git a/apps/fabric-example/common b/apps/fabric-example/common new file mode 120000 index 000000000..83323993b --- /dev/null +++ b/apps/fabric-example/common @@ -0,0 +1 @@ +../common/ \ No newline at end of file diff --git a/apps/paper-example/common b/apps/paper-example/common new file mode 120000 index 000000000..83323993b --- /dev/null +++ b/apps/paper-example/common @@ -0,0 +1 @@ +../common/ \ No newline at end of file diff --git a/apps/tests-example/common b/apps/tests-example/common new file mode 120000 index 000000000..83323993b --- /dev/null +++ b/apps/tests-example/common @@ -0,0 +1 @@ +../common/ \ No newline at end of file