question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to setup changing the default Sizes

See original GitHub issue

Thank 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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hungdevcommented, Mar 31, 2021

@nirsky thank you. I dont understand why, maybe due to cache. Now it worked.

1reaction
nirskycommented, Mar 29, 2021

I see. I’ll try to reproduce it locally on my machine then.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found