#Responsive Header

6 messages · Page 1 of 1 (latest)

sterile holly
#

@novel oriole Post your questions here

#

If you are rerendering your component atleast pass a props on which you set it active to. on each and every page

novel oriole
#

Can we have a meet or something?

sterile holly
#
interface HeaderResponsiveProps {
  links?: { link: string; label: string }[];
  currentLocation: number;
}




export function Header_new({ links, currentLocation }: HeaderResponsiveProps) {
  const [opened, { toggle, close }] = useDisclosure(false);
  const [active, setActive] = useState(datas.links[currentLocation].link);
  const { classes, cx } = useStyles();

return ( ... ) 
export function schemePage{

return (
  <Header_new currentLocation={1} />

)

}
export function communityPage{

return (
  <Header_new currentLocation={2} /> // the integer corresponds in your datas array which consists your links

)

}
export function communityPage{

return (
  <Header_new currentLocation={2} />

)

}
export function blogPage{

return (
  <Header_new currentLocation={3} />

)

}

Hope i made it clear for you as you are using different approach and it can be solved this way

sterile holly
novel oriole
#

Okay got it