8000 GitHub - coder-xiaotian/swc-useclient at 0e1f356de22052d6f01b6d0bc2ebcc99b70a85ab
[go: up one dir, main page]

Skip to content

A swc plugin that automatically converts React component libraries into "React Client Component". For example, you can automatically convert components from @mui into "React Client Component" without having to wrap a component that uses "use client".

License

Notifications You must be signed in to change notification settings

coder-xiaotian/swc-useclient

Repository files navigation

use-client

中文

NPM npm Rust

A swc plugin that automatically converts React component libraries into "React Client Component". For example, you can automatically convert components from @mui into "React Client Component" without having to wrap a component that uses "use client".

Installation

npm:

npm install -D use-client

yarn:

yarn add -D use-client

pnpm:

pnpm i -D use-client

Configuration

  • include: ["@mui/material"]

Examples

next.js configuration:

const nextConfig = {
  experimental: {
    swcPlugins: [
      [
        "use-client",
        {
          include: ["@mui/material"],
        },
      ],
    ],
  },
};

swc configuration:

{
  "$schema": "https://json.schemastore.org/swcrc",
  "jsc": {
    "experimental": {
      "plugins": [
        ["use-client", {
          "include": ["@mui/material"]
        }]
      ]
    }
  }
}

About

A swc plugin that automatically converts React component libraries into "React Client Component". For example, you can automatically convert components from @mui into "React Client Component" without having to wrap a component that uses "use client".

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0