Skip to content

Commit

Permalink
fix: create symlink to common directory (#2512)
Browse files Browse the repository at this point in the history
# 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:
facebook/metro#322 (comment).
  • Loading branch information
jakex7 authored Oct 25, 2024
1 parent cc527df commit 8e865a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/fabric-example/common
1 change: 1 addition & 0 deletions apps/paper-example/common
1 change: 1 addition & 0 deletions apps/tests-example/common

0 comments on commit 8e865a9

Please sign in to comment.