documentation
documentation copied to clipboard
Platform specific files in React Native fail on build
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
Any update on this issue?
In general, we post updates and reference issues when work happens on any issue. This is still an open issue; if anyone wants to help, I'm happy to review and merge PRs.
@adlondon Did you get around to a PR or workaround for this? An ugly workaround seems to be to explicitly define the includes for each platform possibly but this could cause some confusion with files that have different function definitions for each platform.