I looked at a tutorial and wrote exact same code in my App.js to create styled button using makeStyles
but it didn't work.
whenever I'm using makeStyles
it causes other components to disappear. I tried to use it standalone without any other component and it didn't work as well.
this is my App.js
everything should work fine but .....
import React from "react";
import { Button, makeStyles } from "@mui/material";
const useStyles = makeStyles({
root: {
background: "linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)",
border: 0,
borderRadius: 3,
boxShadow: "0 3px 5px 2px rgba(255, 105, 135, .3)",
color: "white",
height: 48,
padding: "0 30px",
},
});
function ButtonStyled() {
const classes = useStyles();
return <Button className={classes.root}>Test</Button>;
}
const App = () => {
return (
<div>
<ButtonStyled />
</div>
);
};
export default App;