Gatsby plugin that transforms JavaScript/TypeScript code inside LiveProvider components to strings using Babel, enabling React Live to display syntax-highlighted source code with full TypeScript support. Version 1.4.5 (latest) works with Gatsby and requires Node >=14.17.0. It is part of the Eufemia design system. Key differentiator: unlike manual stringification, this plugin automatically converts JSX/TSX inside LiveProvider children to string literals, supporting render callbacks with noInline output. Known limitations: currently works only with .tsx files, requires emotion v5, and needs cache clearing after changes to the Babel plugin.
npm install gatsby-plugin-babel-react-liveVerified import paths — ran on the pinned version, not inferred.
Configures the plugin in gatsby-config.js to transform code inside LiveProvider components in .tsx files.
Rename .jsx files to .tsx or wait for a future version with JS support.
Install gatsby-plugin-emotion@5 and configure it in gatsby-config.js.
Run `gatsby clean` before building or developing.
Ensure react-live and babel-plugin-react-live are installed as dependencies.
Rename the file to .tsx or configure webpack to handle .jsx with the plugin's transform.
Upgrade to gatsby-plugin-emotion@5.
Run `yarn add babel-plugin-react-live` or `npm install babel-plugin-react-live`.