Skip to content

Inferno

A fast, React-like JavaScript library for building user interfaces in the browser and on servers.

Stars
16.5k
Forks
642
Licence
MIT
Language
JavaScript
Last update
6 days ago
Type
Library

What it is

Inferno is a JavaScript library for building user interfaces, with an API modeled on React, so many React concepts such as components, props and state carry over. Its stated focus is runtime rendering speed, especially for views that update often with real-time data or render large DOM trees. It can render on the client and on the server using inferno-server.

  • Render a component tree into a page element with render()
  • Build class components with state and lifecycle methods, as in React
  • Use linkEvent to pass data to event handlers without arrow functions or binding
  • Render on the server with inferno-server for isomorphic apps
  • Use createPortal to render a component outside its parent's HTML hierarchy

Great for

  • Developers already familiar with React who want a React-like API
  • Projects that re-render frequently with real-time data or large DOM trees
  • Teams that want server-side rendering through inferno-server
  • Developers who want to use JSX compiled by Babel, SWC or TypeScript plugins

Not ideal for

  • Teams that depend on the React ecosystem of libraries and tooling, since Inferno is a separate library with its own plugins and compatibility details
  • Beginners looking for a large body of tutorials, because the README does not point to a learning path beyond docs and examples
  • Projects on very old runtimes, since the README lists features v9 requires at runtime (Promise, Array.prototype.includes and others) and recommends checking compatibility for your targets
Step-by-step guide: how to use InfernoInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    Clone the repository

    git clone https://github.com/infernojs/inferno
  2. 2

    Run it

    • Install the inferno package from npm, or set up the Babel, SWC or TypeScript plugin for JSX if you use JSX
    • Import render and Component from 'inferno'
    • Call render(<MyComponent />, document.getElementById('app')) to mount your component
    • Optionally add a class component with state and a render method, as shown in the README examples
  3. 3

    Get the most out of it

    • Use the compile-time child flags such as $HasVNodeChildren and $HasTextChildren when you know the shape of children, as the README describes
    • Use linkEvent to avoid creating new arrow functions for event handlers
    • Use inferno-compat if you need camelCase style object syntax
    • Use inferno-animation with componentDidAppear, componentWillDisappear and componentWillMove for animation work
    • Read the v4, v6 and v10 migration guides when upgrading

Downloads

Strengths

  • The README describes compile-time JSX optimizations and child flags that can reduce runtime work
  • Familiar React-like API and component model
  • Works without polyfills on tested browsers, per the README's browser support section

Trade-offs

  • Version 10 requires matching v10 versions of the Babel, SWC or TypeScript plugins, and JSX compiled by older plugins will not work
  • Some performance optimizations, such as child flags, depend on developers following contracts the README warns can crash the app if broken
  • Some React-style features differ, so existing React code may need changes

How it compares

ProjectStarsTypeLevelUpdatedBest for
inferno (this)16.5kLibraryintermediate6 days agoDevelopers already familiar with React who want a React-like API
react252kLibraryintermediate6 days agoDevelopers building interactive web interfaces with JavaScript
preact39kLibraryintermediate4 days agoWeb developers who already know React and want a lighter library
vue212kLibraryintermediate2.1 years agoMaintaining an existing Vue 2 application that cannot yet be upgraded
svelte88.5kLibraryintermediate4 days agoDevelopers who want to build interactive websites with less boilerplate
solid36.2kLibraryintermediate4 days agoDevelopers who want fine-grained control over what re-renders in a web UI

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.