From 47cb37039c56be09a678ac2597663e2bd06d739f Mon Sep 17 00:00:00 2001 From: "S. Andrew Sheppard" Date: Fri, 26 Aug 2022 13:52:10 +0900 Subject: [PATCH] ensure Icon exists --- packages/material/src/components/IconButton.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/material/src/components/IconButton.js b/packages/material/src/components/IconButton.js index 953f0564..c9653a4b 100644 --- a/packages/material/src/components/IconButton.js +++ b/packages/material/src/components/IconButton.js @@ -5,6 +5,9 @@ import PropTypes from 'prop-types'; export default function IconButton({ icon, ...rest }) { const Icon = useIcon(icon); + if (!Icon) { + throw new Error(`"${icon}" is not a registered icon!`); + } return (