Next.js toast error not getting hide.
i am working on next.js first time.i am facing an issue due to which i am getting error message in a toast at bottom left corner. i want to hide that toast. i inspect the element and found the following code:
<div data-nextjs-toast="true" class="nextjs-toast-errors-parent">
<div data-nextjs-toast-wrapper="true">
<div class="nextjs-toast-errors">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"></circle>
<line x1="12" y1="8" x2="12" y2="12"></line>
<line x1="12" y1="16" x2="12.01" y2="16"></line>
</svg>
<span>5 errors</span>
<button data-nextjs-toast-errors-hide-button="true" class="nextjs-toast-errors-hide-button" type="button" aria-label="Hide Errors">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 6L6 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</button>
</div>
</div>
</div>
here is the css details corresponding to the above code's
.nextjs-toast-errors-parent {
cursor: pointer;
transition: transform 0.2s ease;
}
if i try to add
display:none;
in the above css , then it disappears.
so i come to my vs code and add the following code in my globals.css file
.nextjs-toast-errors-parent {
cursor: pointer;
transition: transform 0.2s ease;
diplay:none;
}
but it does not work. i try to put the !important with display:none but that is also not working.
i found a something on the internet that is nextjs-portal
so i implement the following
nextjs-portal {
display: none;
}
it hides all the errors , not even toast error but also the overlay errors.
how i can resolve this issue , i am unable to figure out why my css code is not working. is there any other way to implement this.
