Props and pass data from object list
obj list
const Brand= [
{
name:"biplav",
song : "chalu haa",
},
{
name:"emiway",
song : "malum haa na",
},
{
name:"Rafter",
song : "Swag mara desi",
},
{
name:"ikka",
song : "half window",
}
]
export default Brand;
import react from "react";
import Brand from "./Reel";
console.log(Brand);
function M1() {
return (
<div>
<h1>{Brand[0].name}</h1>
<h1>{Brand[0].song}</h1>
<h1>{Brand[1].name}</h1>
</div>
);
}
export default M1;
import "./styles.css";
import M1 from "./Chal"
export default function App() {
function P1(props){
return(
<div>
<h1>{props.car}</h1>
<h1>{props.car}</h1>
<h1>{props.car}</h1>
<h1>{props.car}</h1>
</div>
)
}
return (
<div className="App">
<M1 />
<P1 name="biplav"
car = "Bmw"
money="yoyo" />
<h1>Hello CodeSandbox</h1>
<h2>Start editing to see some magic happen!</h2>
</div>
);
}
Comments
Post a Comment