On unmount `Section` still showing it as a section on `useScrollSections`
Description
When I unmount a Section, I expected that the return of useScrollSections just includes the mounted sections, but it stores all registered sections.
Link to Reproduction
https://codesandbox.io/s/react-scroll-section-unmount-issue-5g2l3?file=/src/App.js
Steps to reproduce
Add more sections and see that it still shows on useScrollSections returns on unmount that section.
Additional Information
A use case that this behavior will impact is building a page's table of contents. If the user navigates over multiple pages, the previous sections will never disappear from the list of content.
Having the same issue.
As an 'ugly' workarround we reused the Section id forcing the update inside the context.
As mentioned in the PR #365, this is now fixed :)
Check the code sandbox using the latest version --> https://codesandbox.io/s/react-scroll-section-unmount-issue-forked-ggv9b3?file=/src/App.js
I will proceed to close the issue. Feel free to open it again in case there is something unresolved.