Question 1:-
//[Link]
function UserProfile(props) {
return (
<p>
Username: {[Link]} | Age: {[Link]} | Location: {[Link]}
</p>
);
}
export default UserProfile;
//[Link]
import UserProfile from './UserProfile';
function App() {
return (
<div>
<UserProfile username="John" age={25} location="New York" />
</div>
);
}
export default App;
Question 2:-
//[Link]
function StyledButton({ buttonText, color, size }) {
return (
<button style={{ backgroundColor: color, fontSize: size }}>
{buttonText}
</button>
);
}
export default StyledButton;
//[Link]
import StyledButton from './StyledButton';
function App() {
return (
<div>
<StyledButton buttonText="Click Me" color="blue" size="18px" />
</div>
);
}
export default App;