TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Write CSS inside your JavaScript

4 pointsby Trisellabout 9 years ago

2 comments

fbonettiabout 9 years ago
This is basically jQuery for CSS. You need to manually update the stylesheet in response to events, instead of changing the state and having the virtual DOM do the work for you.<p>I&#x27;m really surprised the author went through all the trouble of making this, considering that you can handle dynamic styling via inline styles in React.<p><pre><code> class MyComponent { render() { return ( &lt;div style={{color: this.state.color}}&gt; My Text &lt;&#x2F;div&gt; ); } }</code></pre>
arunkjnabout 9 years ago
This is really interesting stuff