Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-next-use-client

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

babel-plugin-transform-next-use-client

A Babel plugin that adds the "use client" directive for React components that are using client-only APIs

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-plugin-transform-next-use-client

A Babel plugin that adds the "use client" directive for React components that are using client-only APIs such as useEffect and useState.

Installation

npm:

npm install babel-plugin-transform-next-use-client

yarn:

yarn add babel-plugin-transform-next-use-client

Setup

{
  plugins: ['babel-plugin-transform-next-use-client']
}

React client APIs in custom modules

If you are using React client APIs in modules that are imported into your components, you will need to specify an additional option customClientImports so the plugin will add the directive appropriately. This option accepts an array of names corresponding to the functions that use the React client APIs.

{
  plugins: [
    [
      'babel-plugin-transform-next-use-client',
      {
        customClientImports: [
          'useCustomHook'
        ]
      }
    ]
  ]
}

Keywords

FAQs

Package last updated on 28 Jun 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc