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.

react-native --icon should be 24 not 1em

See original GitHub issue

🐛 Bug Report

In react native 1em width does nothing - suppose to be rem?

To Reproduce

Go to playground https://react-svgr.com/playground/?icon=true&native=true&typescript=true

Expected behavior

I would like to get results with width and height as 24

<Svg
      xmlns="http://www.w3.org/2000/svg"
      width={24}
      height={24}

Workaround in .svgrrc.js

        [
          "@svgr/babel-plugin-replace-jsx-attribute-value",
          {
            "values": [
              { "value": "1em", "newValue": 24 },
            ]
          }
        ]
## System:
 - OS: macOS 11.4
 - CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
 - Memory: 49.51 MB / 16.00 GB
 - Shell: 5.8 - /bin/zsh
## Binaries:
 - Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
 - Yarn: 1.22.10 - ~/.nvm/versions/node/v14.17.0/bin/yarn
 - npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
 - Watchman: 2021.06.07.00 - /usr/local/bin/watchman
## npmPackages:
 - @svgr/cli: ^5.5.0 => 5.5.0 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gregbergecommented, Sep 17, 2021

@FDiskas OK we need to make it configurable then. There is no way to specify something that can be decided later by user or implied by font size like em?

0reactions
FDiskascommented, Sep 17, 2021

I was thinking 🤔 if there is option “native” so that could mean that em is not valid any more in the output and would be replaced to simple integers if it has --icon pram. But to configure the output size would be nice addition. Like: --icon=16 or something

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing Icon Dimensions in Iconify for React
By default, icon height is set to "1em", icon width is changed dynamically based on the icon's width to height ratio. This makes...
Read more >
how to scale (large) font-awesome icons from the react- ...
The default size is 1em. You can change it like this: import { FcSurvey } from 'react-icons/fc'; <FcSurvey size={'2em'} />.
Read more >
Size Matters: How I used React Native to make my App ...
When working with React Native, the iPhone 7 has a 375dp width and 667dp height and a Galaxy Tab A 8.0" Tablet (the...
Read more >
iconify/react
By default, icon height is "1em". With is dynamic, calculated using the icon's width to height ratio. This makes it easy to change...
Read more >
Sizing Icons | Font Awesome Docs
We'll cover the basics of industry standard sizing recommendations, and how you can size icons up when it's useful, or when text alignment...
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