Why is this working fine with 'gatsby build' and not working with 'gatsby develop'? #38363
Unanswered
lukolszewski
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im trying to build a simple navbar with the current page entry using a different class.
I'm using the code from the tutorial, with index.js that imports layout.js and that imports header.js. I'm passing the pageTitle and the menuLinks to the header. There I'm using menuLinks.map to create multiple
elements for my menu. I have a ternary statement in the li that checks if pageTitle equals to current link.name and selects classes based on that.
The weird behavior is that if I run gatsby build the resulting static files are perfectly fine. The classes are correctly assigned. However when I'm running gatsby develop it is as if my ternary never gets processed. Neither of the class is assigned.
What's even weirder is that while the develop server is runnig I can change the class names in the ternary and it will work once, but then if I refresh it disappears again. Any advice? I'd rather not have to use client side JS for something that can be done on the server side.
Here is the header.js code:
Beta Was this translation helpful? Give feedback.
All reactions