Registry / web-framework / babel-plugin-jsx-wrap-if

babel-plugin-jsx-wrap-if

JSON →
library0.1.1jsnpmunverified

Babel plugin for React that conditionally wraps JSX elements based on a prop. Version 0.1.1, no active maintenance. When the `wrap-if` prop is truthy, the element wraps its children; when falsy, the children are rendered without the wrapper. Simple alternative to inline ternaries or helper components. No updates since 2019, likely abandoned. Only 1 GitHub star. Use for legacy projects or simple conditional wrapping without extra components.

npm install babel-plugin-jsx-wrap-if
INSTALL
IMPORT
SIG · BABEL-PLUGIN-JSX-W
B
babel-plugin-jsx-wrap-if
web-frameworkjavascriptv0.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
module.exports = { plugins: ['jsx-wrap-if'] }
import plugin from 'babel-plugin-jsx-wrap-if'
Used as a Babel plugin string in config, not imported directly in source code.

Shows how to configure the Babel plugin and use the wrap-if prop in JSX for conditional rendering.

// babel.config.js module.exports = { plugins: ['jsx-wrap-if'] }; // React component function ConditionalBlock({ condition, children }) { return ( <blockquote wrap-if={condition}> {children} </blockquote> ); }
Debug
Known issues
deprecatedPackage is unmaintained since 2019.
fix
Consider using inline ternary or a conditional wrapper component instead.
affects: All
Errors
Common errors & fixes
Error: Cannot find module 'babel-plugin-jsx-wrap-if'
Missing npm install or typo in plugin name.
fix
Run 'npm install babel-plugin-jsx-wrap-if --save-dev' and verify plugin string is 'jsx-wrap-if'.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
babel-plugin-jsx-wrap-if — npm install babel-plugin-jsx-wrap-if · libregistry