Skip to content

Instantly share code, notes, and snippets.

@mjackson
Last active March 7, 2018 05:38
Can we just plop some CSS right smack in the middle of our JavaScript code?!
import React from "react";
body {
font-family: Helvetica, sans-serif;
}
.header-text {
font-weight: bold;
font-size: 2em;
}
class MyComponent extends React.Component {
render() {
return (
<div>
<h1 className="header-text">Hello there!</h1>
</div>
);
}
}
export default MyComponent;
@omermindivanli
Copy link

No you cannot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment