This content originally appeared on flaviocopes.com and was authored by flaviocopes.com
I wanted to display some information on the website only if it was in development, on my local machine, and not in the deployed website.
Here’s how I did it:
const isDev = process.env.NODE_ENV === 'development'
{isDev && (
<p>local only</p>
)}
This content originally appeared on flaviocopes.com and was authored by flaviocopes.com
flaviocopes.com | Sciencx (2021-05-08T05:00:00+00:00) Next.js how to show something in development and hide in production. Retrieved from https://www.scien.cx/2021/05/08/next-js-how-to-show-something-in-development-and-hide-in-production/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.