![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
unplugin-jsx-string
Advanced tools
Converts JSX to HTML strings at compile time.
npm i unplugin-jsx-string
// vite.config.ts
import JsxString from 'unplugin-jsx-string/vite'
export default defineConfig({
plugins: [JsxString()],
})
// rollup.config.js
import JsxString from 'unplugin-jsx-string/rollup'
export default {
plugins: [JsxString()],
}
// esbuild.config.js
import { build } from 'esbuild'
build({
plugins: [require('unplugin-jsx-string/esbuild')()],
})
// webpack.config.js
module.exports = {
/* ... */
plugins: [require('unplugin-jsx-string/webpack')()],
}
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [require('unplugin-jsx-string/webpack')()],
},
}
// tsconfig.json
{
"compilerOptions": {
// ...
"types": ["unplugin-jsx-string" /* ... */]
}
}
// basic usage
jsxToString(<div>Hello</div>)
// "<div>Hello</div>"
// class list
jsxToString(<div className={['bar', 'foo']} />)
// `<div class="bar foo"/>`
// styles
jsxToString(<div style={{ color: 'red', textAlign: 'center' }} />)
// `<div style="color:red;text-align:center"/>`
// events
jsxToString(<button onClick={() => 'clicked'}></button>)
// "<button onclick="'clicked'"></button>"
// children
jsxToString(
<div>
<p>foo</p>
<p>bar</p>
<br />
<div />
123
</div>
)
// "<div><p>foo</p><p>bar</p><br/><div/>123</div>"
<div>Hello World</div> x 89,429 ops/sec ±0.88% (95 runs sampled)
<div><img src={'foo'} /><div></div></div> x 62,522 ops/sec ±0.62% (93 runs sampled)
Tested on Apple M1 Max / 32GB
More samples are welcome.
FAQs
Converts JSX to HTML strings at compile time.
We found that unplugin-jsx-string demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.