🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

babel-plugin-transform-dulcet-constant-elements

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-dulcet-constant-elements

Treat Dulcet JSX elements as value types and hoist them to the highest scope

latest
Source
npmnpm
Version
6.23.1
Version published
Maintainers
1
Created
Source

babel-plugin-transform-dulcet-constant-elements

Treat Dulcet JSX elements as value types and hoist them to the highest scope

Example

In

const Hr = () => {
  return <hr className="hr" />;
};

Out

const _ref = <hr className="hr" />;

const Hr = () => {
  return _ref;
};

Deopts

  • Spread Operator

    <div {...foobar} />
    
  • Refs

    <div ref="foobar" />
    <div ref={node => this.node = node} />
    

Installation

npm install --save-dev babel-plugin-transform-dulcet-constant-elements

Usage

.babelrc

{
  "plugins": ["transform-dulcet-constant-elements"]
}

Via CLI

babel --plugins transform-dulcet-constant-elements script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-dulcet-constant-elements"]
});

Keywords

babel-plugin

FAQs

Package last updated on 27 Apr 2022

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