{"id":13394368,"url":"https://github.com/infernojs/inferno","last_synced_at":"2026-03-17T21:35:38.077Z","repository":{"id":26704543,"uuid":"30161665","full_name":"infernojs/inferno","owner":"infernojs","description":":fire: An extremely fast, React-like JavaScript library for building modern user interfaces","archived":false,"fork":false,"pushed_at":"2026-02-14T13:01:20.000Z","size":46549,"stargazers_count":16411,"open_issues_count":40,"forks_count":639,"subscribers_count":256,"default_branch":"master","last_synced_at":"2026-03-17T19:54:31.598Z","etag":null,"topics":["inferno","inferno-component","inferno-js","javascript-library","jsx","performance","react","vdom"],"latest_commit_sha":null,"homepage":"https://infernojs.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infernojs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"inferno"}},"created_at":"2015-02-01T22:07:38.000Z","updated_at":"2026-03-17T07:10:43.000Z","dependencies_parsed_at":"2023-12-17T10:25:50.123Z","dependency_job_id":"d32c394e-55d9-4e0b-98ba-346c7077fe66","html_url":"https://github.com/infernojs/inferno","commit_stats":{"total_commits":5604,"total_committers":226,"mean_commits":24.79646017699115,"dds":0.7798001427551748,"last_synced_commit":"2499d62c7802c02e6f8adb9ecc80498ea83e8493"},"previous_names":["trueadm/inferno","trueadm/enginejs","trueadm/infernojs"],"tags_count":285,"template":false,"template_full_name":null,"purl":"pkg:github/infernojs/inferno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infernojs%2Finferno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infernojs%2Finferno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infernojs%2Finferno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infernojs%2Finferno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infernojs","download_url":"https://codeload.github.com/infernojs/inferno/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infernojs%2Finferno/sbom","scorecard":{"id":487873,"data":{"date":"2025-08-11","repo":{"name":"github.com/infernojs/inferno","commit":"1351469efc467c011e7de463d078eac3e5644040"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":3,"reason":"2 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/ci-template.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-template.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/infernojs/inferno/ci-template.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-template.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/infernojs/inferno/ci-template.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci-template.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/infernojs/inferno/ci-template.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/infernojs/inferno/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/infernojs/inferno/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/infernojs/inferno/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/infernojs/inferno/codeql-analysis.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (1) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T18:15:58.717Z","repository_id":26704543,"created_at":"2025-08-19T18:15:58.717Z","updated_at":"2025-08-19T18:15:58.717Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30632049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inferno","inferno-component","inferno-js","javascript-library","jsx","performance","react","vdom"],"created_at":"2024-07-30T17:01:17.267Z","updated_at":"2026-03-17T21:35:38.056Z","avatar_url":"https://github.com/infernojs.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://infernojs.org/\" target=\"_blank\"\u003e\u003cimg width=\"150\" alt=\"Inferno\" title=\"Inferno\" src=\"https://user-images.githubusercontent.com/2021355/36063342-626d7ea8-0e84-11e8-84e1-f22bb3b8c4d5.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\n[![Build Status](https://github.com/infernojs/inferno/workflows/CI/badge.svg)](https://github.com/infernojs/inferno/actions)\n[![Coverage Status](https://img.shields.io/coveralls/infernojs/inferno/master.svg?style=flat-square)](https://coveralls.io/github/infernojs/inferno?branch=master)\n[![MIT](https://img.shields.io/npm/l/inferno.svg?style=flat-square)](https://github.com/infernojs/inferno/blob/master/LICENSE.md)\n[![NPM](https://img.shields.io/npm/v/inferno.svg?style=flat-square)](https://www.npmjs.com/package/inferno)\n[![npm downloads](https://img.shields.io/npm/dm/inferno.svg?style=flat-square)](https://www.npmjs.org/package/inferno)\n[![Discord](https://img.shields.io/discord/825669396823015496.svg?style=flat-square\u0026label=\u0026logo=discord\u0026logoColor=ffffff\u0026color=7389D8\u0026labelColor=6A7EC2)](https://discord.gg/SUKuhgaBpF)\n[![gzip size](http://img.badgesize.io/https://unpkg.com/inferno/dist/inferno.min.js?compression=gzip)](https://unpkg.com/inferno/dist/inferno.min.js)\n[![Backers on Open Collective](https://opencollective.com/inferno/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/inferno/sponsors/badge.svg)](#sponsors)\n\nInferno is an insanely fast, React-like library for building high-performance user interfaces on both the client and server.\n\n## Description\n\nThe main objective of the InfernoJS project is to provide the fastest possible **runtime** performance for web applications. Inferno excels at rendering real time data views or large DOM trees.\n\nThe performance is achieved through multiple optimizations, for example:\n\n- Inferno's own JSX compilers creates monomorphic `createVNode` calls, instead of `createElement` calls.\nOptimizing runtime performance of the application. \n  - [SWC plugin inferno](https://github.com/infernojs/swc-plugin-inferno) is a plugin for [SWC](https://swc.rs/). It can compile TSX and JSX\n  - [Babel plugin inferno](https://github.com/infernojs/babel-plugin-inferno) is a plugin for [BabelJs](https://babeljs.io/). It can compile JSX.\n  - [TS plugin inferno](https://github.com/infernojs/ts-plugin-inferno) is a plugin for [TSC](https://www.typescriptlang.org/). It can compile TSX.\n- Inferno's diff process uses bitwise flags to memoize the shape of objects\n- Child nodes are normalized only when needed\n- Special JSX flags can be used during compile time to optimize runtime performance at application level\n- Many micro optimizations\n\n## Features\n\n- Component driven + one-way data flow architecture\n- React-like API, concepts and component lifecycle events\n- Partial synthetic event system, normalizing events for better cross browser support\n- Inferno's [`linkEvent`](https://github.com/infernojs/inferno/blob/master/README.md#linkevent-package-inferno) feature removes the need to use arrow functions or binding event callbacks\n- Isomorphic rendering on both client and server with `inferno-server`\n- Unlike React and Preact, Inferno has lifecycle events on functional components\n- Unlike Preact and other React-like libraries, Inferno has controlled components for input/select/textarea elements\n- Components can be rendered outside their current html hierarchy using `createPortal` - API\n- Support for [older browsers](https://github.com/infernojs/inferno#browser-support) without any polyfills\n- defaultHooks for Functional components, this way re-defining lifecycle events per usage can be avoided\n- Inferno supports setting styles using string `\u003cdiv style=\"background-color: red\"\u003e\u003c/div\u003e` or using object literal syntax `\u003cdiv style={{\"background-color\": \"red\"}}\u003e\u003c/div\u003e`. For camelCase syntax support see [`inferno-compat`](https://github.com/infernojs/inferno/tree/master/packages/inferno-compat).\n- Fragments (v6)\n- createRef and forwardRef APIs (v6)\n- componentDidAppear, componentWillDisappear and componentWillMove (v8) - class and function component callbacks to ease animation work, see [inferno-animation](https://github.com/infernojs/inferno/tree/master/packages/inferno-animation) package\n\n## Runtime requirements\nInferno v9 requires following features to be present in the executing runtime:\n\n- `Promise`\n- `String.prototype.includes()`\n- `String.prototype.startsWith()`\n- `Array.prototype.includes()`\n- `Object.spread()`\n- `for ... of`\n\n## Browser support\nSince version 4 we have started running our test suite **without** any polyfills.\nInferno is now part of [Saucelabs](https://saucelabs.com/) open source program and we use their service for executing the tests.\n\nInfernoJS is actively tested with browsers listed below, however it may run well on older browsers as well.\nThis is due to limited support of browser versions in recent testing frameworks. https://github.com/jasmine/jasmine/blob/main/release_notes/5.0.0.md\n\n[![Browser Test Status](https://app.saucelabs.com/browser-matrix/Havunen.svg)](https://app.saucelabs.com/open_sauce/user/Havunen/tests/vdc)\n\n## Migration guides\n\n- [Inferno v4](https://github.com/infernojs/inferno/blob/master/documentation/v4-migration.md)\n- [Inferno v6](https://github.com/infernojs/inferno/blob/master/documentation/v6-migration.md)\n\n## Benchmarks\n\nLive examples at [https://infernojs.github.io/inferno](https://infernojs.github.io/inferno)\n\n- [UI Bench](https://localvoid.github.io/uibench/)\n- [dbmonster](https://infernojs.github.io/inferno/dbmonster/)\n- [JS Web Frameworks Benchmark (current)](https://krausest.github.io/js-framework-benchmark/current.html)\n- [Isomorphic-UI-Benchmark](https://github.com/marko-js/isomorphic-ui-benchmarks)\n- [1k Components](https://infernojs.github.io/inferno/1kcomponents/)\n\n## Code Example\n\nLet's start with some code. As you can see, Inferno intentionally keeps the same design ideas as React regarding components: one-way data flow and separation of concerns.\n\nIn these examples, JSX is used via the [Inferno JSX Babel Plugin](https://github.com/infernojs/babel-plugin-inferno) to provide a simple way to express Inferno virtual DOM. You do not need to use JSX, it's completely **optional**, you can use [hyperscript](https://github.com/infernojs/inferno/tree/master/packages/inferno-hyperscript) or [createElement](https://github.com/infernojs/inferno/tree/master/packages/inferno-create-element) (like React does).\nKeep in mind that compile time optimizations are available only for JSX.\n\n```jsx\nimport { render } from 'inferno';\n\nconst message = \"Hello world\";\n\nrender(\n  \u003cMyComponent message={ message } /\u003e,\n  document.getElementById(\"app\")\n);\n```\nFurthermore, Inferno also uses ES6 components like React:\n\n```jsx\nimport { render, Component } from 'inferno';\n\nclass MyComponent extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      counter: 0\n    };\n  }\n  render() {\n    return (\n      \u003cdiv\u003e\n        \u003ch1\u003eHeader!\u003c/h1\u003e\n        \u003cspan\u003eCounter is at: { this.state.counter }\u003c/span\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nrender(\n  \u003cMyComponent /\u003e,\n  document.getElementById(\"app\")\n);\n```\n\nBecause performance is an important aspect of this library, we want to show you how to optimize your application even further.\nIn the example below we optimize diffing process by using JSX **$HasVNodeChildren** and **$HasTextChildren** to predefine children shape compile time.\nIn the MyComponent render method there is a div that contains JSX expression `node` as its content. Due to dynamic nature of Javascript\nthat variable `node` could be anything and Inferno needs to go through the normalization process to make sure there are no nested arrays or other invalid data.\nInferno offers a feature called ChildFlags for application developers to pre-define the shape of vNode's child node. In this example case\nit is using `$HasVNodeChildren` to tell the JSX compiler, that this vNode contains only single element or component vNode.\nNow inferno will not go into the normalization process runtime, but trusts the developer decision about the shape of the object and correctness of data.\nIf this contract is not kept and `node` variable contains invalid value for the pre-defined shape (fe. `null`), then application would crash runtime.\nThere is also span-element in the same render method, which content is set dynamically through `_getText()` method. There `$HasTextChildren` child-flag\nfits nicely, because the content of that given \"span\" is never anything else than text.\nAll the available child flags are documented [here](https://infernojs.org/docs/guides/optimizations).\n\n```jsx\nimport { createTextVNode, render, Component } from 'inferno';\n\nclass MyComponent extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      counter: 0\n    };\n  }\n\n  _getText() {\n     return 'Hello!';\n  }\n  \n  render() {\n    const node = this.state.counter \u003e 0 ? \u003cdiv\u003e0\u003c/div\u003e : \u003cspan $HasTextChildren\u003e{this._getText()}\u003c/span\u003e;\n      \n    return (\n      \u003cdiv\u003e\n        \u003ch1\u003eHeader!\u003c/h1\u003e\n        \u003cdiv $HasVNodeChildren\u003e{node}\u003c/div\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nrender(\n  \u003cMyComponent /\u003e,\n  document.getElementById(\"app\")\n);\n```\n\n### Tear down\n\nTo tear down inferno application you need to render null on root element. \nRendering `null` will trigger unmount lifecycle hooks for whole vDOM tree and remove global event listeners.\nIt is important to unmount unused vNode trees to free browser memory. \n\n```jsx\nimport { createTextVNode, render, Component } from 'inferno';\n\nconst rootElement = document.getElementById(\"app\");\n\n// Start the application\nrender(\n  \u003cExampleComponent/\u003e,\n  rootElement\n);\n\n// Tear down\nrender(\n  null,\n  rootElement\n);\n\n```\n\n\n### More Examples\n\nIf you have built something using Inferno you can add them here:\n\n- [**Simple Clock** (@JSFiddle)](https://jsfiddle.net/4bha7kcg/)\n- [**Simple JS Counter** (@github/scorsi)](https://github.com/scorsi/simple-counter-inferno-cerebral-fusebox): SSR Inferno (view) + Cerebral (state manager) + FuseBox (build system/bundler)\n- [**Online interface to TMDb movie database** (@codesandbox.io)](https://codesandbox.io/s/9zjo5yx8po): Inferno + [Inferno hyperscript](https://github.com/infernojs/inferno) (view) + [Superagent](https://github.com/visionmedia/superagent) (network requests) + Web component ([custom elements v1](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)) + [state-transducer](https://github.com/brucou/state-transducer) \n(state machine library) \n- [**Lemmy - a self-hostable reddit alternative** (front end in Inferno)](https://github.com/dessalines/lemmy)\n\n## Getting Started\n\nThe easiest way to get started with Inferno is by using [Create Inferno App](https://github.com/infernojs/create-inferno-app).\n\nAlternatively, you can try any of the following:\n* the [Inferno Boilerplate](https://github.com/infernojs/inferno-boilerplate) for a very simple setup.\n* for a more advanced example demonstrating how Inferno might be used, we recommend trying out [Inferno Starter Project](https://github.com/nightwolfz/inferno-starter) by [nightwolfz](https://github.com/nightwolfz/).\n* for using Inferno to build a mobile app, try [Inferno Mobile Starter Project](https://github.com/Rudy-Zidan/inferno-mobile) by [Rudy-Zidan](https://github.com/Rudy-Zidan).\n* for [TypeScript](https://www.typescriptlang.org/) support and bundling, check out [ts-plugin-inferno](https://github.com/infernojs/ts-plugin-inferno), or [inferno-typescript-example](https://github.com/infernojs/inferno-typescript-example).\n* for an example of how to use Inferno in [codesandbox](https://codesandbox.io/): https://codesandbox.io/s/znmyj24w4p\n* for using [parcel and typescript](https://github.com/jayy-lmao/inferno-parcel-ts)\n\nCore package:\n\n```sh\nnpm install --save inferno\n```\n\nAddons:\n\n```sh\n# server-side rendering\nnpm install --save inferno-server\n# routing\nnpm install --save inferno-router\n```\n\nPre-bundled files for browser consumption can be found on [our cdnjs](https://cdnjs.com/libraries/inferno):\n\nOr on jsDelivr:\n\n```\nhttps://cdn.jsdelivr.net/npm/inferno@latest/dist/inferno.min.js\n```\n\nOr on unpkg.com:\n\n```\nhttps://unpkg.com/inferno@latest/dist/inferno.min.js\n```\n\n### Creating Virtual DOM\n\n#### JSX:\n```sh\nnpm install --save-dev babel-plugin-inferno\n```\n\n#### Hyperscript:\n```sh\nnpm install --save inferno-hyperscript\n```\n\n#### createElement:\n```sh\nnpm install --save inferno-create-element\n```\n\n### Compatibility with existing React apps\n```sh\nnpm install --save-dev inferno-compat\n```\n\nNote: Make sure you read more about [`inferno-compat`](https://github.com/infernojs/inferno/tree/master/packages/inferno-compat) before using it.\n\n## Third-party state libraries\n\nInferno now has bindings available for some of the major state management libraries out there:\n\n- Redux via [`inferno-redux`](https://github.com/infernojs/inferno/tree/dev/packages/inferno-redux)\n- MobX via [`inferno-mobx`](https://github.com/infernojs/inferno/tree/dev/packages/inferno-mobx)\n- Cerebral via [`@cerebral/inferno`](https://github.com/cerebral/cerebral/tree/master/packages/node_modules/@cerebral/inferno)\n\n## JSX\n\nInferno has its own [JSX Babel plugin](https://github.com/trueadm/babel-plugin-inferno).\n\n## Differences from React\n\n- Inferno doesn't have a fully synthetic event system like React does. Inferno has a partially synthetic event system, instead opting to only delegate certain events (such as `onClick`).\n- Inferno doesn't support React Native. Inferno was only designed for the browser/server with the DOM in mind.\n- Inferno doesn't support legacy string refs, use `createRef` or callback `ref` API\n- Inferno provides lifecycle events on functional components. This is a major win for people who prefer lightweight components rather than ES2015 classes.\n\n## Differences from Preact\n\n- Inferno has a partial synthetic event system, resulting in better performance via delegation of certain events.\n- Inferno is *much* faster than Preact in rendering, updating and removing elements from the DOM. Inferno diffs against virtual DOM, rather than the real DOM (except when loading from server-side rendered content), which means it can make drastic improvements. Unfortunately, diffing against the real DOM has a 30-40% overhead cost in operations.\n- Inferno fully supports controlled components for `input`/`select`/`textarea` elements. This prevents lots of edgecases where the virtual DOM is not the source of truth (it should always be). Preact pushes the source of truth to the DOM itself.\n- Inferno provides lifecycle events on functional components. This is a major win for people who prefer lightweight components rather than ES2015 classes.\n\n## Event System\n\nLike React, Inferno also uses a light-weight synthetic event system in certain places (although both event systems differ massively). Inferno's event system provides highly efficient delegation and an event helper called [`linkEvent`](https://github.com/infernojs/inferno/blob/master/README.md#linkevent-package-inferno).\n\nOne major difference between Inferno and React is that Inferno does not rename events or change how they work by default. Inferno only specifies that events should be camel cased, rather than lower case. Lower case events will bypass\nInferno's event system in favour of using the native event system supplied by the browser. For example, when detecting changes on an `\u003cinput\u003e` element, in React you'd use `onChange`, with Inferno you'd use `onInput` instead (the\nnative DOM event is `oninput`).\n\nAvailable synthetic events are:\n- `onClick`\n- `onDblClick`\n- `onFocusIn`\n- `onFocusOut`\n- `onKeyDown`\n- `onKeyPress`\n- `onKeyUp`\n- `onMouseDown`\n- `onMouseMove`\n- `onMouseUp`\n- `onTouchEnd`\n- `onTouchMove`\n- `onTouchStart`\n\n### `linkEvent` (package: `inferno`)\n\n`linkEvent()` is a helper function that allows attachment of `props`/`state`/`context` or other data to events without needing to `bind()` them or use arrow functions/closures. This is extremely useful when dealing with events in functional components. Below is an example:\n\n```jsx\nimport { linkEvent } from 'inferno';\n\nfunction handleClick(props, event) {\n  props.validateValue(event.target.value);\n}\n\nfunction MyComponent(props) {\n  return \u003cdiv\u003e\u003cinput type=\"text\" onClick={ linkEvent(props, handleClick) } /\u003e\u003cdiv\u003e;\n}\n```\n\nThis is an example of using it with ES2015 classes:\n\n\n```jsx\nimport { linkEvent, Component } from 'inferno';\n\nfunction handleClick(instance, event) {\n  instance.setState({ data: event.target.value });\n}\n\nclass MyComponent extends Component {\n  render () {\n    return \u003cdiv\u003e\u003cinput type=\"text\" onClick={ linkEvent(this, handleClick) } /\u003e\u003cdiv\u003e;\n  }\n}\n```\n\n`linkEvent()` offers better performance than binding an event in a class constructor and using arrow functions, so use it where possible.\n\n\n## Controlled Components\n\nIn HTML, form elements such as `\u003cinput\u003e`, `\u003ctextarea\u003e`, and `\u003cselect\u003e` typically maintain their own state and update it based on user input.\nIn Inferno, mutable state is typically kept in the state property of components, and only updated with `setState()`.\n\nWe can combine the two by making the Inferno state be the \"single source of truth\". Then the Inferno component that renders a form also\ncontrols what happens in that form on subsequent user input. An input form element whose value is controlled by\nInferno in this way is called a \"controlled component\".\n\n## Inferno Top-Level API\n\n### `render` (package: `inferno`)\n\n```javascript\nimport { render } from 'inferno';\n\nrender(\u003cdiv /\u003e, document.getElementById(\"app\"));\n```\n\nRender a virtual node into the DOM in the supplied container given the supplied virtual DOM. If the virtual node was previously rendered\ninto the container, this will perform an update on it and only mutate the DOM as necessary, to reflect the latest Inferno virtual node.\n\nWarning: If the container element is not empty before rendering, the content of the container will be overwritten on the initial render.\n\n### `createRenderer` (package: `inferno`)\n\n`createRenderer` creates an alternative render function with a signature matching that of the first argument passed to a reduce/scan function. This allows for easier integration with reactive programming libraries, like [RxJS](https://github.com/ReactiveX/rxjs) and [Most](https://github.com/cujojs/most).\n\n```javascript\nimport { createRenderer } from 'inferno';\nimport { scan, map } from 'most';\n\nconst renderer = createRenderer();\n\n\n// NOTE: vNodes$ represents a stream of virtual DOM node updates\nscan(renderer, document.getElementById(\"app\"), vNodes$);\n```\n\nSee [inferno-most-fp-demo](https://github.com/joshburgess/inferno-most-fp-demo) for an example of how to build an app architecture around this.\n\n### `createElement` (package: `inferno-create-element`)\n\nCreates an Inferno VNode using a similar API to that found with React's `createElement()`\n\n```javascript\nimport { Component, render } from 'inferno';\nimport { createElement } from 'inferno-create-element';\n\nclass BasicComponent extends Component {\n  render() {\n    return createElement('div', {\n        className: 'basic'\n      },\n      createElement('span', {\n        className: this.props.name\n      }, 'The title is ', this.props.title)\n    )\n  }\n}\n\nrender(\n  createElement(BasicComponent, { title: 'abc' }),\n  document.getElementById(\"app\")\n);\n```\n\n### `Component` (package: `inferno`)\n\n**Class component:**\n\n```javascript\nimport { Component } from 'inferno';\n\nclass MyComponent extends Component {\n  render() {\n      return \u003cdiv\u003eMy Component\u003c/div\u003e\n  }\n}\n```\n\nThis is the base class for Inferno Components when they're defined using ES6 classes.\n\n**Functional component:**\n\n```javascript\nconst MyComponent = ({ name, age }) =\u003e (\n  \u003cspan\u003eMy name is: { name } and my age is: {age}\u003c/span\u003e\n);\n```\n\nAnother way of using defaultHooks.\n```javascript\nexport function Static() {\n    return \u003cdiv\u003e1\u003c/div\u003e;\n}\n\nStatic.defaultHooks = {\n    onComponentShouldUpdate() {\n        return false;\n    }\n};\n```\n\nDefault props\n```jsx\nexport function MyFunctionalComponent({value}) {\n    return \u003cdiv\u003e{value}\u003c/div\u003e;\n}\n\nMyFunctionalComponent.defaultProps = {\n    value: 10\n};\n\n```\n\nFunctional components are first-class functions where their first argument is the `props` passed through from their parent.\n\n### `createVNode` (package: `inferno`)\n```js\nimport { createVNode } from 'inferno';\n\ncreateVNode(\n  flags,\n  type,\n  [className],\n  [...children],\n  [childFlags],\n  [props],\n  [key],\n  [ref]\n)\n```\n\ncreateVNode is used to create html element's virtual node object. Typically `createElement()` (package: `inferno-create-element`), `h()` (package: `inferno-hyperscript`) or JSX are used to create\n`VNode`s for Inferno, but under the hood they all use `createVNode()`. Below is an example of `createVNode` usage:\n\n```javascript\nimport { VNodeFlags, ChildFlags } from 'inferno-vnode-flags';\nimport { createVNode, createTextVNode, render } from 'inferno';\n\nconst vNode = createVNode(VNodeFlags.HtmlElement, 'div', 'example', createTextVNode('Hello world!'), ChildFlags.HasVNodeChildren);\n\n// \u003cdiv class=\"example\"\u003eHello world!\u003c/div\u003e\n\nrender(vNode, container);\n```\n\n`createVNode` arguments explained:\n\n`flags`: (number) is a value from [`VNodeFlags`](https://github.com/infernojs/inferno/tree/master/packages/inferno-vnode-flags), this is a numerical value that tells Inferno what the VNode describes on the page.\n\n`type`: (string) is tagName for element for example 'div'\n\n`className`: (string) is the class attribute ( it is separated from props because it is the most commonly used property )\n\n`children`: (vNode[]|vNode) is one or array of vNodes to be added as children for this vNode\n\n`childFlags`: (number) is a value from [`ChildFlags`](https://github.com/infernojs/inferno/tree/master/packages/inferno-vnode-flags), this tells inferno shape of the children so normalization process can be skipped.\n\n`props`: (Object) is object containing all other properties. fe: `{onClick: method, 'data-attribute': 'Hello Community!}`\n\n`key`: (string|number) unique key within this vNodes siblings to identify it during keyed algorithm.\n\n`ref`: (function) callback which is called when DOM node is added/removed from DOM.\n\n\n### `createComponentVNode` (package: 'inferno')\n```js\nimport { createComponentVNode } from 'inferno';\n\ncreateComponentVNode(\n  flags,\n  type,\n  [props],\n  [key],\n  [ref]\n)\n```\n\ncreateComponentVNode is used for creating vNode for Class/Functional Component.\n\nExample:\n```javascript\nimport { VNodeFlags, ChildFlags } from 'inferno-vnode-flags';\nimport { createVNode, createTextVNode, createComponentVNode, render } from 'inferno';\n\nfunction MyComponent(props, context) {\n  return createVNode(VNodeFlags.HtmlElement, 'div', 'example', createTextVNode(props.greeting), ChildFlags.HasVNodeChildren);\n}\n\nconst vNode = createComponentVNode(VNodeFlags.ComponentFunction, MyComponent, {\n  greeting: 'Hello Community!'\n}, null, {\n  onComponentDidMount() {\n    console.log(\"example of did mount hook!\")\n  }\n})\n\n// \u003cdiv class=\"example\"\u003eHello Community!\u003c/div\u003e\n\nrender(vNode, container);\n```\n\n\n`createComponentVNode` arguments explained:\n\n`flags`: (number) is a value from [`VNodeFlags`](https://github.com/infernojs/inferno/tree/master/packages/inferno-vnode-flags), this is a numerical value that tells Inferno what the VNode describes on the page.\n\n`type`: (Function/Class) is the class or function prototype for Component\n\n`props`: (Object) properties passed to Component, can be anything\n\n`key`: (string|number) unique key within this vNodes siblings to identify it during keyed algorithm.\n\n`ref`: (Function|Object) this property is object for Functional Components defining all its lifecycle methods. For class Components this is function callback for ref.\n\n\n\n### `createTextVNode` (package: 'inferno')\n\ncreateTextVNode is used for creating vNode for text nodes.\n\n`createTextVNode` arguments explained:\ntext: (string) is a value for text node to be created.\nkey: (string|number) unique key within this vNodes siblings to identify it during keyed algorithm.\n\n```js\nimport { createTextVNode } from 'inferno';\n\ncreateTextVNode(\n  text,\n  key\n)\n```\n\n\n### `cloneVNode` (package: `inferno-clone-vnode`)\n\nThis package has same API as React.cloneElement\n\n```javascript\nimport { cloneVNode } from 'inferno-clone-vnode';\n\ncloneVNode(\n  vNode,\n  [props],\n  [...children]\n)\n```\n\nClone and return a new Inferno `VNode` using a `VNode` as the starting point. The resulting `VNode` will have the original `VNode`'s props with the new props merged in shallowly. New children will replace existing children. key and ref from the original `VNode` will be preserved.\n\n`cloneVNode()` is almost equivalent to:\n```jsx\n\u003cVNode.type {...VNode.props} {...props}\u003e{children}\u003c/VNode.type\u003e\n```\n\nAn example of using `cloneVNode`:\n\n```javascript\nimport { createVNode, render } from 'inferno';\nimport { cloneVNode } from 'inferno-clone-vnode';\nimport { VNodeFlags } from 'inferno-vnode-flags';\n\nconst vNode = createVNode(VNodeFlags.HtmlElement, 'div', 'example', 'Hello world!');\nconst newVNode = cloneVNode(vNode, { id: 'new' }); // we are adding an id prop to the VNode\n\nrender(newVNode, container);\n```\n\nIf you're using JSX:\n\n```jsx\nimport { render } from 'inferno';\nimport { cloneVNode } from 'inferno-clone-vnode';\n\nconst vNode = \u003cdiv className=\"example\"\u003eHello world\u003c/div\u003e;\nconst newVNode = cloneVNode(vNode, { id: 'new' }); // we are adding an id prop to the VNode\n\nrender(newVNode, container);\n```\n\n### `createPortal` (package: 'inferno')\n\nHTML:\n```html\n\u003cdiv id=\"root\"\u003e\u003c/div\u003e\n\u003cdiv id=\"outside\"\u003e\u003c/div\u003e\n```\n\nJavascript:\n```jsx\nconst { render, Component, version, createPortal } from 'inferno';\n\nfunction Outsider(props) {\n\treturn \u003cdiv\u003e{`Hello ${props.name}!`}\u003c/div\u003e;\n}\n\nconst outsideDiv = document.getElementById('outside');\nconst rootDiv = document.getElementById('root');\n\nfunction App() {\n\treturn (\n  \t    \u003cdiv\u003e\n    \t    Main view\n            ...\n            {createPortal(\u003cOutsider name=\"Inferno\" /\u003e, outsideDiv)}\n        \u003c/div\u003e\n    );\n}\n\n\n// render an instance of Clock into \u003cbody\u003e:\nrender(\u003cApp /\u003e, rootDiv);\n```\n\nResults into:\n```html\n\u003cdiv id=\"root\"\u003e\n    \u003cdiv\u003eMain view ...\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"outside\"\u003e\n    \u003cdiv\u003eHello Inferno!\u003c/div\u003e\n\u003c/div\u003e\n```\nCool, huh? Updates (props/context) will flow into \"Outsider\" component from the App component the same way as any other Component.\nFor inspiration on how to use it click [here](https://hackernoon.com/using-a-react-16-portal-to-do-something-cool-2a2d627b0202)!\n\n### `createRef` (package: `inferno`)\n\ncreateRef API provides shorter syntax than callback ref when timing of element is not needed.\n\n```jsx\nimport { Component, render, createRef } from 'inferno';\n\nclass Foobar extends Component {\n  constructor(props) {\n    super(props);\n\n    // Store reference somewhere\n    this.element = createRef(); // Returns object {current: null}\n  }\n\n  render() {\n    return (\n      \u003cdiv\u003e\n        \u003cspan id=\"span\" ref={this.element}\u003e\n          Ok\n        \u003c/span\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nrender(\u003cFoobar /\u003e, container);\n```\n\n\n### `createFragment` (package: `inferno`)\n\ncreateFragment is the native way to createFragment vNode. `createFragment(children: any, childFlags: ChildFlags, key?: string | number | null)`\n\n`createFragment` arguments explained:\n\n`children`: (Array) Content of fragment vNode, typically array of VNodes\n\n`childFlags`: (number) is a value from [`ChildFlags`](https://github.com/infernojs/inferno/tree/master/packages/inferno-vnode-flags), this tells inferno shape of the children so normalization process can be skipped.\n\n`key`: (string|number) unique key within this vNodes siblings to identify it during keyed algorithm.\n\n\nAlternative ways to create fragment vNode are:\n\n- Using JSX `\u003c\u003e ... \u003c/\u003e`, `\u003cFragment\u003e .... \u003c/Fragment\u003e` or `\u003cInferno.Fragment\u003e ... \u003c/Inferno.Fragment\u003e`\n- Using createElement API `createElement(Inferno.Fragment, {key: 'test'}, ...children)`\n- Using hyperscript API `h(Inferno.Fragment, {key: 'test'}, children)`\n\n\nIn the below example both fragments are identical except they have different key\n```jsx\nimport { Fragment, render, createFragment } from 'inferno';\nimport { ChildFlags } from 'inferno-vnode-flags';\n\nfunction Foobar() {\n    return (\n      \u003cdiv $HasKeyedChildren\u003e\n        {createFragment(\n            [\u003cdiv\u003eOk\u003c/div\u003e, \u003cspan\u003e1\u003c/span\u003e],\n            ChildFlags.HasNonKeyedChildren,\n            'key1'\n        )}\n        \u003cFragment key=\"key2\"\u003e\n          \u003cdiv\u003eOk\u003c/div\u003e\n          \u003cspan\u003e1\u003c/span\u003e\n        \u003c/Fragment\u003e\n      \u003c/div\u003e\n    );\n}\n\nrender(\u003cFoobar /\u003e, container);\n```\n\n\n### `forwardRef` (package: `inferno`)\n\nforwardRef is a new mechanism to \"forward\" ref inside a functional Component.\nIt can be useful if you have simple functional Components and you want to create reference to a specific element inside it.\n\n```jsx\nimport { forwardRef, Component, render } from 'inferno';\n\nconst FancyButton = forwardRef((props, ref) =\u003e (\n  \u003cbutton ref={ref} className=\"FancyButton\"\u003e\n    {props.children}\n  \u003c/button\u003e\n));\n\nclass Hello extends Component {\n  render() {\n    return (\n      \u003cFancyButton\n        ref={btn =\u003e {\n          if (btn) {\n            // btn variable is the button rendered from FancyButton\n          }\n        }}\n      \u003e\n        Click me!\n      \u003c/FancyButton\u003e\n    );\n  }\n}\n\nrender(\u003cHello /\u003e, container);\n```\n\n### `hydrate` (package: `inferno-hydrate`)\n\n```javascript\nimport { hydrate } from 'inferno-hydrate';\n\nhydrate(\u003cdiv /\u003e, document.getElementById(\"app\"));\n```\n\nSame as `render()`, but is used to hydrate a container whose HTML contents were rendered by `inferno-server`. Inferno will attempt to attach event listeners to the existing markup.\n\n### `findDOMNode` (package: `inferno-extras`)\nThis feature has been moved from inferno to inferno-compat in v6. No options are needed anymore.\n\nNote: we recommend using a `ref` callback on a component to find its instance, rather than using `findDOMNode()`. `findDOMNode()` cannot be used on functional components.\n\nIf a component has been mounted into the DOM, this returns the corresponding native browser DOM element. This method is useful for reading values out of the DOM, such as form field values and performing DOM measurements.\nIn most cases, you can attach a ref to the DOM node and avoid using `findDOMNode()` at all. When render returns null or false, `findDOMNode()` returns null.\nIf Component has rendered fragment it returns the first element.\n\n### Inferno Flags (package: inferno-vnode-flags)\n\n**VNodeFlags:**\n- `VNodeFlags.HtmlElement`\n- `VNodeFlags.ComponentUnknown`\n- `VNodeFlags.ComponentClass`\n- `VNodeFlags.ComponentFunction`\n- `VNodeFlags.Text`\n- `VNodeFlags.SvgElement`\n- `VNodeFlags.InputElement`\n- `VNodeFlags.TextareaElement`\n- `VNodeFlags.SelectElement`\n- `VNodeFlags.Portal`\n- `VNodeFlags.ReCreate` (JSX **$ReCreate**) always re-creates the vNode\n- `VNodeFlags.ContentEditable`\n- `VNodeFlags.Fragment`\n- `VNodeFlags.InUse`\n- `VnodeFlags.ForwardRef`\n- `VNodeFlags.Normalized`\n\n**VNodeFlags Masks:**\n- `VNodeFlags.ForwardRefComponent` Functional component wrapped in forward ref\n- `VNodeFlags.FormElement` - Is form element\n- `VNodeFlags.Element` - Is vNode element\n- `VNodeFlags.Component` - Is vNode Component\n- `VNodeFlags.DOMRef` - Bit set when vNode holds DOM reference\n- `VNodeFlags.InUseOrNormalized` - VNode is used somewhere else or came from normalization process\n- `VNodeFlags.ClearInUseNormalized` - Opposite mask of InUse or Normalized\n\n\n**ChildFlags**\n- `ChildFlags.UnknownChildren` needs Normalization\n- `ChildFlags.HasInvalidChildren` is invalid (null, undefined, false, true)\n- `ChildFlags.HasVNodeChildren` (JSX **$HasVNodeChildren**) is single vNode (Element/Component)\n- `ChildFlags.HasNonKeyedChildren` (JSX **$HasNonKeyedChildren**) is Array of vNodes non keyed (no nesting, no holes)\n- `ChildFlags.HasKeyedChildren` (JSX **$HasKeyedChildren**) is Array of vNodes keyed (no nesting, no holes)\n- `ChildFlags.HasTextChildren` (JSX **$HasTextChildren**) vNode contains only text\n\n**ChildFlags Masks**\n- `ChildFlags.MultipleChildren` Is Array\n\n\n### `renderToString` (package: `inferno-server`)\n\n```javascript\nimport { renderToString } from 'inferno-server';\n\nconst string = renderToString(\u003cdiv /\u003e);\n```\n\nRender a virtual node into an HTML string, given the supplied virtual DOM.\n\n## Functional component lifecycle events\n\n| Name                        | Triggered when                                                  | Arguments to callback           |\n| -----------                 | --------------                                                  | -----------------------         |\n| `onComponentWillMount`      | a functional component is about to mount                        |                                 |\n| `onComponentDidMount`       | a functional component has mounted successfully                 | `domNode`                       |\n| `onComponentShouldUpdate`   | a functional component has been triggered to update             | `lastProps, nextProps`          |\n| `onComponentWillUpdate`     | a functional component is about to perform an update            | `lastProps, nextProps`          |\n| `onComponentDidUpdate`      | a functional component has performed an update                  | `lastProps, nextProps`          |\n| `onComponentWillUnmount`    | a functional component is about to be unmounted                 | `domNode`                       |\n| `onComponentDidAppear`      | a functional component has mounted and is ready for animations  | `domNode, props`                |\n| `onComponentWillDisappear`  | a functional component is unmounted before DOM node is removed  | `domNode, props, callback`      |\n\nonComponentWillDisappear has special type of argument \"callback\" which needs to be called when component is ready to be removed from the DOM. fe. after animations are finished.\n\n## Class component lifecycle events\n\nAll these Component lifecycle methods ( including `render` and `setState - callback`) are called with Component instance context. You don't need to \"bind\" these methods.\n\n| Name                              | Triggered when                                                                        | Arguments to callback           |\n| -----------                       | --------------                                                                        | -----------------------         |\n| `componentDidMount`               | component has been mounted successfully                                                |                                 |\n| `componentWillMount`              | component is about to mount                                                           |                                 |\n| `componentWillReceiveProps`       | before render when component updates                                                  | `nextProps, context`            |\n| `shouldComponentUpdate`           | component has been triggered to update                                                | `nextProps, nextState`          |\n| `componentWillUpdate`             | component is about to perform an update                                               | `nextProps, nextState, context` |\n| `componentDidUpdate`              | component has performed an update                                                     | `lastProps, lastState, snapshot`|\n| `componentWillUnmount`            | component is about to be unmounted                                                    |                                 |\n| `getChildContext`                 | before render method, return value object is combined to sub tree context             |                                 |\n| `getSnapshotBeforeUpdate`         | before component updates, return value is sent to componentDidUpdate as 3rd parameter | `lastProps, lastState`          |\n| `static getDerivedStateFromProps` | before render method                                                                  | `nextProps, state`              |\n| `componentDidAppear`              | component has mounted and is ready for animations                                     | `domNode`                       |\n| `componentWillDisappear`          | component is unmounted before DOM node is removed                                     | `domNode, callback`             |\n\ncomponentWillDisappear has special type of argument \"callback\" which needs to be called when component is ready to be removed from the DOM. fe. after animations are finished.\n\n### Using functional lifecycle events\n\nFunctional lifecycle events must be explicitly assigned via props onto a functional component like shown below:\n\n```javascript\nimport { render } from 'inferno';\n\nfunction mounted(domNode) {\n  // [domNode] will be available for DOM nodes and components (if the component has mounted to the DOM)\n}\n\nfunction FunctionalComponent({ props }) {\n  return \u003cdiv\u003eHello world\u003c/div\u003e;\n}\n\nrender(\n  \u003cFunctionalComponent onComponentDidMount={ mounted } /\u003e,\n  document.getElementById(\"app\")\n);\n```\n\nPlease note: class components (ES2015 classes) from `inferno` **do not** support the same lifecycle events (they have their own lifecycle events that work as methods on the class itself).\n\n## Development vs Production modes\n\nBy default, Inferno will run in development mode. Development mode provides extra checks and better error messages at the cost of slower performance and larger code to parse.\nWhen using Inferno in a production environment, it is highly recommended that you turn off development mode.\n\n### Running Inferno on Node JS\n\nEnsure the environment variable `process.env.NODE_ENV` is set to `production`.\n\n## Application bundling\n\nWhen building your application bundle, ensure `process.env.NODE_ENV` is replaced with string`\"development\"` or `\"production\"` based on the workflow.\nIt is recommended to use [ts-plugin-inferno](https://github.com/infernojs/ts-plugin-inferno) for typescript TSX compilation and [babel-plugin-infeno](https://github.com/infernojs/babel-plugin-inferno) for javascript JSX compilation.\n\nWhen building for development, you may want to use `inferno.dev.mjs` for v9 or newer and `inferno.dev.esm.js` for older than v9. That bundle file contains ES6 exports for better tree-shaking support, improved error messages and added validation to help fixing possible issues during development.\nThe file is found from `package.json` - `dev:module` entry point and the files are physically located in `node_modules/inferno/dist/` folder.\nRemember that it is not recommended to use that file in production due to slower performance. For production usage use `node_modules/inferno/dist/inferno.mjs` -file for v9 or newer and `node_modules/inferno/dist/inferno.esm.js` -file for older than v9.\n\nExample of **Webpack** configuration:\n\n```js\nconst path = require('path');\nconst infernoTsx = require('ts-plugin-inferno').default;\n\n... webpack config ...\n\n    module: {\n        rules: [\n            {\n                test: /\\.js$/, // Add \"jsx\" if your application uses `jsx` file extensions\n                exclude: /node_modules/,\n                use: [{\n                    loader: 'babel-loader',\n                    options: {\n                        plugins: [\n                            // Compile javascript JSX syntax using inferno's own plugin\n                            ['babel-plugin-inferno', {imports: true}]\n                        ]\n                    }\n                }]\n            },\n            {\n                test: /\\.ts+(|x)$/, // Compile ts and tsx extensions\n                exclude: /node_modules/,\n                use: [{\n                    loader: 'ts-loader',\n                    options: {\n                        getCustomTransformers: () =\u003e ({\n                            // inferno custom TSX plugin\n                            after: [infernoTsx()]\n                        }),\n                        compilerOptions: {\n                            /* typescript compiler options */\n                        }\n                    }\n                }]\n            }\n        ]\n    },\n    resolve: {\n        extensions: ['.js', '.ts', '.tsx'],\n        alias: {\n            // This maps import \"inferno\" to es6 module entry based on workflow\n            inferno: path.resolve(__dirname, 'node_modules/inferno/dist', isProduction ? 'index.dev.mjs' : 'index.mjs')\n        }\n    },\n    plugins: [\n        new webpack.DefinePlugin({\n            'process.env': {\n                'NODE_ENV':  JSON.stringify(isProduction ? 'production' : 'development')\n            }\n        })\n    ]\n```\n\nExample of **Rollup** configuration:\n\n```js\nconst path = require('path');\nconst alias = require('@rollup/plugin-alias');\nconst {babel} = require('@rollup/plugin-babel');\nconst replace = require('@rollup/plugin-replace');\nconst typescript = require('rollup-plugin-typescript2');\nconst transformInferno = require('ts-plugin-inferno').default;\n\n... Rollup config ...\n{\n    input: /* entry file */,\n    plugins: [\n            alias({\n                resolve: ['.js'],\n                entries: [\n                    // This maps import \"inferno\" to es6 module entry based on workflow\n                    {find: 'inferno', replacement: path.resolve(__dirname, 'node_modules/inferno/dist', isProduction ? 'index.dev.mjs' : 'index.mjs')}\n                ]\n            }),\n            typescript({\n                include: ['*.ts+(|x)', '**/*.ts+(|x)'],\n                transformers: [\n                    () =\u003e ({\n                        after: [transformInferno()]\n                    })\n                ],\n                tsconfig: 'tsconfig.json',\n                tsconfigOverride: {\n                    /* typescript compiler options */\n                }\n            }),\n            babel({\n                babelrc: false,\n                sourceMaps: isDeploy,\n                plugins: [\n                    // Compile javascript JSX syntax using inferno's own plugin\n                    ['babel-plugin-inferno', {imports: true}]\n                ],\n                babelHelpers: 'bundled'\n            })\n    ]\n}\n```\n\n### Custom namespaces\n\nInferno always wants to deliver great performance. In order to do so, it has to make intelligent assumptions about the state of the DOM and the elements available to mutate. Custom namespaces conflict with this idea and change the schema of how different elements and attributes might work, so Inferno makes no attempt to support namespaces. Instead, SVG namespaces are automatically applied to elements and attributes based on their `tag name`.\n\n## Development\nIf you want to contribute code, fork this project and submit a PR from your fork. To run browser tests you need to build the repos. A complete rebuild of the repos can take \u003e5 mins.\n\n```sh\n$ git clone git@github.com:infernojs/inferno.git\n$ cd inferno \u0026\u0026 npm i\n$ npm run test:node\n$ npm run build\n$ npm run test:browser\n```\n\nIf you only want to run the browser tests when coding, use the following to reduce turnaround by 50-80%:\n\n```sh\n$ npm run quick-test:browser # Compiles all packages and runs browser tests\n$ npm run quick-test:browser-inferno # Only compiles the inferno package and runs browser tests\n$ npm run quick-test:browser-debug # Compiles all packages and runs browser tests with \"debug\"\n```\n\n## Community\n\nThere is an InfernoJS Discord. You can join via [https://discord.gg/SUKuhgaBpF](https://discord.gg/SUKuhgaBpF).\n\n\n### Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/infernojs/inferno/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/inferno/contributors.svg?width=890\" /\u003e\u003c/a\u003e\n\n\n### Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/inferno#backer)]\n\n\u003ca href=\"https://opencollective.com/inferno#backers\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/backers.svg?width=890\"\u003e\u003c/a\u003e\n\n\n### Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/inferno#sponsor)]\n\n\u003ca href=\"https://opencollective.com/inferno/sponsor/0/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/1/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/2/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/3/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/4/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/5/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/6/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/7/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/8/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/inferno/sponsor/9/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/inferno/sponsor/9/avatar.svg\"\u003e\u003c/a\u003e\n\n","funding_links":["https://opencollective.com/inferno"],"categories":["JavaScript","App Frameworks","About Inferno","react 相关库","目录","Libraries","MVC Frameworks and Libraries","MVC Frameworks and Libraries [🔝](#readme)",":file_folder: Browser","MVC 框架和库","Uncategorized"],"sub_categories":["Inferno General Resources","macros","JavaScript","Runner","MVVM Framework","运行器","\u003ca id=\"react-like\"\u003e类react框架\u003c/a\u003e","运行器e2e测试","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfernojs%2Finferno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfernojs%2Finferno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfernojs%2Finferno/lists"}