I'm new at ReactJS and now i'm using Next.js. Well, my project has a audio player at header. When site is load this audio player start automatically. And when I change the page the header statements are not change but music start over again. I try higher order component and shallow but these are not work.
So, how can add a player to header and the player wont start over when the page is change.
After researching lots days, I solved similar problem with this:
https://nextjs.org/docs/basic-features/layouts
Just make a HOC wrapped the whole _app and set what you want to do in the HOC.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.