import React from 'react';
var nav1 = [
"SERVICE APP",
"ONLINE ORDER:+91 7303434043",
"CONTACT US",
"STATUS LOCATOR",
"MUMBAI",
"TRACK ORDER",
]
var nav2=[
{
'title':"HAFELE KARIA",
'image': "./images/img1."
},
{
'title':"BOAT WATCH",
'image': "./images/img2."
},
{
'title':"SONY TV",
'image': "./images/img3.",
},
{
'title':"WASHING MACHINE",
'image': "./images/img4."
},
{
'title':"AIRPODS PRO",
'image': "./images/img5."
},
{
'title':"JBL",
'image': "./images/img6."
},
{
'title':"LG OFFER",
'image': "./images/img7."
},
{
'title':"LG BUY FROM HOME",
'image': "./images/img8."
},
{
'title':"PLAYSTATION 5",
'image': "./images/img9."
},
{
'title':"OPPO RENO",
'image': "./images/img10."
},
]
export default {
nav1,
nav2,
}
Here I have 2 lists one is for the navbar-1 and the second list is for navbar-2. This is my 'data.js' code and I want to export these 2 list but I am not able to do it so!
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import React from 'react';
import './index.css';
import nav1img from "./images/nav1.png";
import { FaMobileAlt } from 'react-icons/fa';
import nav1 from './data';
import nav2 from './data';
const Navbar1 = () => {
console.log(nav2);
return (
<div className="row1">
<div className="left">
<img src={nav1img} alt="Product" />
</div>
<a href="#"><FaMobileAlt className="icon1" /></a>
<div className="right">
{
nav1.map((item, index) => {
return <>
<a href="#" key={index}>
{item}
</a>
<h1>|</h1>
</>
})
}
</div>
</div>
);
}
export default Navbar1;
And This is my component where I am not able to import the first and second list
How should I export and import the nav1 and nav2 lists?