scalable-react / scalable-react-boilerplate

:star: Scalable feature-first React micro-framework made for Udacity Alumni collaborative projects
https://scalable-react-boilerplate.herokuapp.com/
MIT License
259 stars 56 forks source link

not using preventDefault(). #78

Closed RyszardRzepa closed 7 years ago

RyszardRzepa commented 7 years ago

Hey Ryan!

So far it is the best react boilerplate i found! Great job!!

Thanks to you I discovered groomet UI framework. It's a amazing tool.

I ma just wondering why you are not using preventDefault() to prevent refreshing the pages during the navigation?

Ryszard

RyanCCollins commented 7 years ago

Hey @RyszardRzepa, I would recommend using the Anchor component's path vs. href. The grommet team added this a few months ago and I have yet to have a chance to update the source code for the example site.

Thank you for your kind words and I am glad you found Grommet!! I recently joined their team. They are all-stars in my mind.

If you get a chance to, I'd love a PR that fixes the nav links. Otherwise, I can do it shortly.

All the best!

<Anchor href="/" className={pathname === '/' ? 'active' : ''}>
  Home
</Anchor>

// should be
<Anchor path="/" className={pathname === '/' ? 'active' : ''}>
  Home
</Anchor>