I am currently utilizing React to design some buttons and using CSS to style them accordingly. One of the classes I have created is called Button:
export default class Button extends React.Component{
public className: string;
constructor(props){
super(props);
this.className = props.className ? props.className : "";
}
public render() {
return (
<button className = {this.className}>
{this.value}
</button>
);
}
}
This is the CSS code I have implemented:
.my-css {
width: 300px;
height: 200px;
border-radius: 8px;
}
And here is how I am using it:
<Button className = "my-css" value = "Test" />
I am puzzled as to why my rule does not seem to be loaded when inspecting the page. Can anyone provide an explanation for this?
Any help would be greatly appreciated! :-)