Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Some documentation
  • Loading branch information
acoates-ms committed May 7, 2020
commit 121ea011ab4c3ca94c7e51ee9915f86ff819d391
8 changes: 8 additions & 0 deletions docs/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ At the end, a map of available platforms is passed to the bundler (Metro) to mak

```ts
type PlatformConfig<ProjectParams, ProjectConfig, DependencyConfig> = {
npmPackageName?: string;
projectConfig: (string, ProjectParams) => ?ProjectConfig,
dependencyConfig: (string, ProjectParams) => ?DependencyConfig,
linkConfig: () => {
Expand All @@ -57,6 +58,13 @@ type PlatformConfig<ProjectParams, ProjectConfig, DependencyConfig> = {
};
```

### npmPackageName

Returns the name of the npm package that should be used as the source for react-native JS code for platforms that provide platform specific overrides to core JS files. This causes the default metro config to redirect imports of react-native to another package based when bundling for that platform. The package specified should provide a complete react-native implementation for that platform.

If this property is not specified, it is assumed that the code in core `react-native` works for the platform.


### projectConfig

Returns a project configuration for a given platform or `null`, when no project found. This is later used inside `linkConfig` to perform linking and unlinking.
Expand Down