We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a custom icon (an SVG element) I'd like to put in an Avatar. I can do it, but I get an error/warning about prop types.
Avatar
The text was updated successfully, but these errors were encountered:
Is there a reason you can't do:
render() { const icon = <FontIcon iconClassName={null}><svg ..... /></FontIcon>; return <Avatar icon={icon} />; }
or
render() { return <Avatar src={svgPath} alt="Alt describing icon" />; }
?
I do think that it is still ok to update the PropTypes to allow more than just string for the children prop.
string
children
Sorry, something went wrong.
@mlaursen Yup that might also be a solution!
Allowed Node for Avatar Children #198
eb479ed
It should be completely valid to have any element as a child for the Avatar component, so the prop was updated to allow PropTypes.node.
No branches or pull requests
I have a custom icon (an SVG element) I'd like to put in an
Avatar
. I can do it, but I get an error/warning about prop types.The text was updated successfully, but these errors were encountered: