We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a009660 commit 8d18eeaCopy full SHA for 8d18eea
src/lib_components/components/NeonPage/NeonPage.jsx
@@ -418,12 +418,7 @@ const NeonPage = (props) => {
418
const sidebarHashMap = !hasSidebarLinks ? {} : Object.fromEntries(
419
sidebarLinks.map((link, idx) => [link.hash || '#', idx]),
420
);
421
- const initialCurrentSidebarHash = (() => {
422
- if (sidebarLinks.length === 5) {
423
- return sidebarLinks[3].hash;
424
- }
425
- return '#';
426
- })();
+ const initialCurrentSidebarHash = hasSidebarLinks ? sidebarLinks[0].hash || '#' : '#';
427
const currentSidebarHash = initialCurrentSidebarHash;
428
// const [currentSidebarHash, setCurrentSidebarHash] = useState(initialCurrentSidebarHash);
429
const [hashInitialized, setHashInitialized] = useState(false);
0 commit comments