Create Function Props (PARAM) in REACT JS
import React from 'react';
import { Typography } from "@mui/material";
const Mytypography = ({name}) => {
return (
<>
<Typography variant="h5" sx={{
fontFamily: 'Roboto',
fontWeight: 'bold',
color: 'black' }} gutterBottom>
{name}
</Typography>
</>
);
}
export default Mytypography;
// Uses
<Mytypography name='Avinash'/>
No comments:
Post a Comment