I am trying to develop a mobile view for an application.
I have menus on my footer component, I have header component, pages and subpages (component).
import React from 'react'
import {Link} from Gatsby
export default Nav =() => {
const menu = [
{
url: '/',
title: 'Home',
},
{
url: '/about'
title: 'About'
},
{
url: '/contact'
title: 'Contact'
},
]
return (
<ul>
{menu.map(item => {
<li>
<Link to="{item.title}">{item.title}</Link>
</li>
})}
</ul>
)
}
For my header
I have a place a component to display the content but I want to pass the clicked menu title on the header menu (another component entirely). I want to know how to go about it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…