Conditional Rendering depending on the device
Unanswered
Beveren posted this in #help-forum
BeverenOP
Situation:
Guys, I’m using MUI with Next.js 14 and have encountered an issue where the useMediaQuery hook triggers after the content is already visible on the screen. I’ve researched potential solutions, but they involve trade-offs that seem unreasonable, like making every page dynamic by using middleware and the headers() function.
Question:
How can I achieve proper conditional rendering without sacrificing performance?
Guys, I’m using MUI with Next.js 14 and have encountered an issue where the useMediaQuery hook triggers after the content is already visible on the screen. I’ve researched potential solutions, but they involve trade-offs that seem unreasonable, like making every page dynamic by using middleware and the headers() function.
Question:
How can I achieve proper conditional rendering without sacrificing performance?