abhijithvijayan / react-minimal-side-navigation

Minimal side navigation component for React
https://codesandbox.io/s/react-minimal-side-navigation-example-y299d?file=/src/components/NavSidebar.jsx
MIT License
67 stars 28 forks source link

activeItemId does not change when re-render the component #5

Closed Renan97 closed 3 years ago

Renan97 commented 3 years ago

<Navigation activeItemId={someState}/>

When the state change, the hover effect does not move to the selected item

abhijithvijayan commented 3 years ago

Could you attach a gif for this behaviour?

Renan97 commented 3 years ago

I can show you on a call, google meet or anything

abhijithvijayan commented 3 years ago

You just use a screen recorder and reproduce the behaviour and save as gif. Then attach here.

Renan97 commented 3 years ago

Okay, i will try to record, but this image may could help to understand image

Renan97 commented 3 years ago

On the DebugConsole you can see that "lastSort" is pointed to itemId "distance", but the higlight (in blue) continue on Risk on the right screen, that was the initial value

abhijithvijayan commented 3 years ago

This should work flawlessly. I am using it in many projects as of now.

Can you just make a codesandbox with the same code?

Renan97 commented 3 years ago

Well, i will try to figure out what is happening, cause the problem probably is in my code, if i dont get anywhere i'll reach you again with the real problem

abhijithvijayan commented 3 years ago

Cool. If it doesnt work. Create a reproducible repo with the same code and I will look into it

Renan97 commented 3 years ago

Hey, its me again, finally got time to try it out again. I have created a brand new repository with your nav, and not work as I described earlier could you please take a look again? Thanks! https://github.com/Renan97/testminimalnav

abhijithvijayan commented 3 years ago

Sure

abhijithvijayan commented 3 years ago

fixed in #6, released in v1.6.0

abhijithvijayan commented 3 years ago

@Renan97 Could you test this out and see if it works now?