Skip to content

Commit

Permalink
fix: remove warning when toastMessage = null
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Dec 26, 2023
1 parent ff234b4 commit 72d82d6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/taxonomy/TaxonomyLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ const TaxonomyLayout = () => {
)}
<Outlet />
<StudioFooter />
<Toast
show={toastMessage !== null}
onClose={() => setToastMessage(null)}
data-testid="taxonomy-toast"
>
{toastMessage}
</Toast>
{toastMessage && (
<Toast
onClose={() => setToastMessage(null)}
data-testid="taxonomy-toast"
>
{toastMessage}
</Toast>
)}
</div>
<ScrollRestoration />
</TaxonomyContext.Provider>
Expand Down

0 comments on commit 72d82d6

Please sign in to comment.