Make the default `size` be equal to 1, not null
See original GitHub issuePlease make the size
prop default to 1
if no value is provided. If you leave size off, the icon simply will not render (0 viewbox).
In most cases,
<Icon path={mdiMenu} />
is preferable to
<Icon path={mdiMenu} size={1} />
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Constraints in SQL Server: SQL NOT NULL, UNIQUE and SQL ...
This article explains the useful constraints SQL NOT NULL, Unique and Primary Key constraints in SQL Server examples with user cases.
Read more >Why is adding a NOT NULL column with a default constraint ...
Yes, adding a column with NOT NULL and a default doesn't actually write the values to all the rows at the time of...
Read more >NOT NULL constraint asking for a default value - Stack Overflow
By specifying a default value, you are ensuring that any existing rows are assigned that value, thereby complying with your NOT NULL constraint....
Read more >Altering a Column from Null to Not Null in SQL Server - Chartio
Alter a column from NULL to not NULL in SQL Server by updating existing column data and altering the column data structure to...
Read more >MySQL 8.0 Reference Manual :: 11.6 Data Type Default Values
CREATE TABLE t1 ( i INT DEFAULT -1, c VARCHAR(10) DEFAULT '', price DOUBLE(16,2) DEFAULT 0.00 );. SERIAL DEFAULT VALUE is a special...
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 Free
Top 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
It seems extremely silly to have to specify widths for every use of every icon. I want to use an icon, and I expect it to appear when I put it in my code. If I want to further style that icon, I can then choose to add the optional
size
prop or use CSS.Currently, a page with 15+ icons on it either has to look like:
or
The latter having additional CSS just to get over the hurdle of making the icon appear. Both have more boilerplate than I think should be needed for an out-of-the-box and quick way to get an icon to appear in my app.
EDIT: Perhaps a default class goes on all icons of “mdi”, so that at least all MDI icons can be targeted with CSS instead of needing to specify classes on each use.
So, with this proposal…
Would render:
and
Would render:
I also like this approach, even though it does still require me to put something in my stylesheet just to get an icon to appear, which I find weird.
Prior to the v1.0 release of this it was defaulting to
1
for size, but was causing a lot of issues for people using it alongside their frameworks since it added the style attribute.