Skip to content

Commit

Permalink
fix: alertProps type
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Jan 12, 2024
1 parent bbb0b19 commit bcbd490
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/taxonomy/TaxonomyLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import messages from './messages';
const TaxonomyLayout = () => {
const intl = useIntl();
// Use `setToastMessage` to show the toast.
const [toastMessage, setToastMessage] = useState(null);
const [toastMessage, setToastMessage] = useState(/** @type{null|string} */ null);
// Use `setToastMessage` to show the alert.
const [alertProps, setAlertProps] = useState(null);
const [alertProps, setAlertProps] = useState(/** @type {null|import('./common/context').AlertProps} */ (null));

const context = useMemo(() => ({
toastMessage, setToastMessage, alertProps, setAlertProps,
Expand All @@ -32,7 +32,6 @@ const TaxonomyLayout = () => {
dismissible
closeLabel={intl.formatMessage(messages.taxonomyDismissLabel)}
onClose={() => setAlertProps(null)}
// @ts-ignore ToDo: fix object spread type error
{...alertProps}
/>
)}
Expand Down

0 comments on commit bcbd490

Please sign in to comment.