akveo / akveo/react-native-ui-kitten

Custom mapping with metro config

Offen
#1,607 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
10.7k
Forks
962
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## 💬 Question

In your guides, it is encouraged to inject mapping in the metro confing as mentioned in below code block.

```
const MetroConfig = require('@ui-kitten/metro-config');

const evaConfig = {
evaPackage: '@eva-design/eva',
// Optional, but may be useful when using mapping customization feature.
// customMappingPath: './custom-mapping.json',
};

module.exports = MetroConfig.create(evaConfig, {
// Whatever was previously specified
});
```

I would like to add the mapping in to the **ApplicationProvider** and still use the metro config feature, what are the down sides?

Just FYI, the reason i want to do is that i want to make font sizes and others responsive like for example

```
const {width, height} = Dimensions.get('window');
const rem = width / 414;

export const themeMapping = {
"text-heading-1-font-size": 36 * rem,
}
```

I can't use the rem value, if I import it into evaConfig in metro.config.js

## UI Kitten and Eva version

| Package | Version |
| ----------- | ----------- |
| @eva-design/eva | |
| @ui-kitten/components | |

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.