A lightweight React hook for transpiling JavaScript code on-the-fly using popular transpilers like Babel, TypeScript, etc. Version 0.1.1 is the initial release, currently in early development with an unstable API. The hook is designed for use in sandboxes, REPLs, or code editors where real-time transpilation is needed. It differs from alternatives by being a simple React hook that integrates directly with Babel or TypeScript transpilers, without requiring a build step. However, it is a work-in-progress and not recommended for production use.
npm install use-transpilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of useTranspiler hook to transpile code with Babel on button click.
Pin to exact version and review changelog before upgrading.
Consider waiting for a stable release before using in production.
Always supply a valid transpiler function.
Change to `import { useTranspiler } from 'use-transpiler'`Provide a `transform` key with a transpiler function.