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.

Creating an xsmall SVGIcon fails PropTypes

See original GitHub issue

Expected Behavior

Creating an SVGIcon with xsmall as its size should not throw a PropTypes validation error

Actual Behavior

It works (the icon is rendered smaller than small), but fails validation.

Warning: Failed prop type: Invalid prop 'size' of value 'xsmall' supplied to 'SVGIcon', expected one of ["small","medium","large","xlarge","huge"].

URL, screen shot, or Codepen exhibiting the issue

Codepen

Your Environment

  • Grommet version: 1.3.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SuhairZaincommented, Apr 26, 2017

The PropTypes for SVGIcon includes only small, medium, large, x-large and huge even though the classes for x-small are generated. I’ve added x-small to the PropTypes list.

1reaction
SuhairZaincommented, May 2, 2017

I’m sorry. Was caught up at work. I made the commit but missed making it into a PR. I sincerely apologize. Will make one right away.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to declare types of props of SVG component? [React ...
I've been facing this problem, and this solution worked fine for me: declare module "*.svg" { import { ReactElement, SVGProps } from "react" ......
Read more >
Creating an SVG Icon System with React - CSS-Tricks
We can declare some default props on the icon and then change them, like so: // App const App = React. createClass({ render()...
Read more >
How To Customize React Components with Props
PropTypes are a simple type system to check that data matches the expected types during runtime. They serve as both documentation and an...
Read more >
Typechecking With PropTypes - React
To run typechecking on the props for a component, you can assign the special propTypes property: import PropTypes from 'prop-types'; class Greeting extends ......
Read more >
How to use SVG in React? The styled components way.
Simple, small in size and easy to resize, yet so big and powerful, SVG icons are the . Today, or any day for...
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