🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

preact-jsx-runtime

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preact-jsx-runtime

Preact JSX runtime definition for use with automatic JSX import

1.0.0
Source
npm
Version published
Weekly downloads
547
-4.54%
Maintainers
1
Weekly downloads
 
Created
Source

Preact JSX Runtime

This module serves as an entrypoint for automatic JSX import using Preact. It enables you to use @babel/preset-react's runtime: 'automatic' option by assigning 'preact-jsx-runtime' as the importSource option. In the future, Preact may offer this out-of-the-box.

For more information, refer to the following resources:

Installation

Because preact is defined as a peer dependency, make sure that it's installed if it is not already:

npm install preact

Then, install preact-jsx-runtime as a development dependency:

npm install --dev preact-jsx-runtime

Usage

You will most likely want to assign this as the importSource option of @babel/preset-react.

An example Babel configuration might look like:

{
  "presets": [
    [
      "@babel/preset-react",
      {
        "runtime": "automatic",
        "importSource": "preact-jsx-runtime"
      }
    ]
  ]
}

License

Copyright 2020 Andrew Duthie

Released under the MIT License. See LICENSE.md.

Keywords

preact

FAQs

Package last updated on 08 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts