Next.js Discord

Discord Forum

Eliminate previous styles from higher level layouts when accessing a lower level one

Unanswered
Australian Freshwater Crocodile posted this in #help-forum
Open in Discord
Avatar
Australian Freshwater CrocodileOP
There is a problem. Let's say I have this folder structure on the image.
Now let's say I access the "www.website.com/"
Now I am in "layout.tsx -> layout.tsx -> page.tsx" right?

Now from that page. Let's say I click a "Link" element that redirects to "www.website.com/testing"

The problem here is that the style "globalsMainWebsite.scss" that was imported inside "app(main website)\layout.tsx" is not eliminated. The style doesn't exist when I access "www.website.com/testing" directly because it is never imported...

Basically, how do I clear the style with the Link component? Is there something I don't know?
Image

3 Replies

Avatar
Lesser Goldfinch
The folder structure seems wrong
Avatar
Australian Freshwater CrocodileOP
How so? what can I change?
Avatar
Australian Freshwater CrocodileOP
@Lesser Goldfinch sorry, what do you think is wrong