Passing data between component
In this article going to show how we can pass data between components.
This is very simple in react
In this example we send data App component to Profile component
App component
import React from "react";
import Profile from "./compontents/Profile";
export default function App() {
return (
<>
<Profile userName={"Admin"} email={"example@gmail.com"}></Profile>
</>
);
}
Profile component
import React from "react";
export default function Profile({ userName, email }) {
return (
<>
<p>usaename: {userName}</p>
<p>usaename: {email}</p>
</>
);
}