Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Cycles through multiple color themes.
import { render, Component } from 'inferno';
const themes = ['light-theme','dark-theme','blue-theme'];
class Counter extends Component {
state = { count: 0, current: 0, theme: themes[0] };
increment = () => this.setState({ count: this.state.count + 1 });
decrement = () => this.setState({ count: this.state.count - 1 });
reset = () => this.setState({ count: 0 });
toggleTheme = () => { const next = (this.state.current + 1) % themes.length; this.setState({ current: next, theme: themes[next] }); };
render() {
return (
<div className={this.state.theme}>
<h2>Counter: {this.state.count}</h2>
<div>
<button onClick={this.increment}>+</button>
<button onClick={this.decrement}>-</button>
<button onClick={this.reset}>Reset</button>
</div>
<button onClick={this.toggleTheme}>Switch Theme</button>
</div>
);
}
}
render(<Counter />, document.body);Inferno.js is an extremely fast, lightweight JavaScript library for building high-performance user interfaces. It uses a React-like API and Virtual DOM but is optimized for speed, small size, and predictable rendering.
Origin & Creator
Created by Dominic Gannaway in 2016 as a high-performance alternative to React, with an emphasis on speed and small bundle size.
Industrial Note
Inferno is primarily used in performance-sensitive environments like financial dashboards, advertising tech, streaming interfaces, and embedded web widgets.