How to setup changing the default Sizes
See original GitHub issueThank for your library. @nirsky nirsky
I don’t know what I’m missing.
install lib: npm install babel-plugin-dotenv-import
then add dotenv-import
to babel.config.js
, here is mine:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
"module-resolver",
{
root: [
"./src"
],
extensions: [
'.ios.ts',
'.android.ts',
'.ts',
'.ios.tsx',
'.android.tsx',
'.tsx',
'.jsx',
'.js',
'.json',
],
alias: {
"app": "./src",
"src": "./src",
"components": "./src/components",
"reducers": "./src/reducers",
"config": "./src/config",
"assets": "./src/assets",
"screens": "./src/screens",
"utils": "./src/utils",
"themes": "./src/themes",
"navigation": "./src/appNavigation",
'i18n': "./src/i18n"
}
}
],
[
'@babel/plugin-proposal-decorators',
{
legacy: true
}
],
["dotenv-import", {
"moduleName": "@env",
"path": ".env",
"blacklist": null,
"whitelist": null,
"safe": false,
"allowUndefined": false
}]
],
};
then create .env
file with content:
SIZE_MATTERS_BASE_WIDTH=375
SIZE_MATTERS_BASE_HEIGHT=812
then change import like this: import { ScaledSheet, moderateScale } from 'react-native-size-matters/extend';
But I got error like this
I don’t know what I’m missing, could you tell me what I missed? Thank you so much.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Set The Default Window Size For Command Prompt ...
How To Set The Default Window Size For Command Prompt On Windows 10 ... the same size at the same position on your...
Read more >Change Default Window Sizes in Windows 10
Open the application you wish to, drag and alter the window size you wish to, move to any location on the desktop and...
Read more >How can I change the default paper size in Windows? How do ...
1. Open the document. · 2. Click File => Print. · 3. Click the Properties button. · 4. Next to Paper Size, select...
Read more >How can I change the default paper size? How do I setup a ...
1. Open the document. · 2. Click File => Print. · 3. Click the Properties button. · 4. Next to Paper Size, select...
Read more >How to change default height and width of Windows Terminal
Change Windows Terminal default size using Settings UI · Open Start on Windows 10. · Search for Windows Terminal and click the top...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nirsky thank you. I dont understand why, maybe due to cache. Now it worked.
I see. I’ll try to reproduce it locally on my machine then.