Skip to content

Instantly share code, notes, and snippets.

@rymohr
Created July 16, 2015 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rymohr/310285338c44b6f8cba2 to your computer and use it in GitHub Desktop.
Save rymohr/310285338c44b6f8cba2 to your computer and use it in GitHub Desktop.
How I wish I could write React components
class DreamList extends React.Component {
// Would love to be able to write inline SCSS/LESS
// and have it automatically injected into the document
// when the component was required.
<style>
.dream-list {
margin: 0;
padding: 0;
list-style: none;
}
.dream-list-item {
transition: opacity .5s;
opacity: .5;
&:hover,
&:active,
&.active {
opacity: 1;
}
}
</style>
// And this is a minor one, but it would be nice
// to be able to use "class" instead of "className"
// and have the JSX transpiler convert it for me.
render () {
return (
<ul class="dream-list">
<li class="dream-list-item">One</li>
<li class="dream-list-item">Two</li>
</ul>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment