documentationjs / documentationjs/documentation

Platform specific files in React Native fail on build

Open
#1,062 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

**Version: 6.3.2**
**Framework: react-native**
**File structure:**
```
src
|
+scenes
|
| +--AddressInput
|
+components
|
+--Geolocator.ios.js
|
+--Geolocator.android.js
```
**Code:** `import Geolocator from '/components/Geolocator`
**cli command:** `documentation serve /src`
**Error: Cannot find module './components/Geolocator' from src/scenesAddreswInput**

In react native, platform specific code is automatically inferred by the operating system. This means that importing a component like `Geolocator` does not need an explicit OS declaration.

Documentation is unable to resolve the file path and throws an error. Happy to work on this and submit a PR if it hasn't already been tackled

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.