Creating an xsmall SVGIcon fails PropTypes
See original GitHub issueExpected 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
Your Environment
- Grommet version: 1.3.4
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top 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 >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
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.
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.