JSX pragma slow in dev mode
See original GitHub issueCurrent behavior:
In dev mode, using the jsx pragma, my app is taking several seconds to render.
To reproduce:
Render an app with a lot of react elements using the jsx pragma
Environment information:
react
version: 16.8.6@emotion/core
version: 10.0.14
Actually, I’m using it via theme-ui
with the sx
prop, but after profiling I found the bottleneck is this line from emotion core:
I’m creating the issue just in case there’s some easy optimization to replace the new Error
bottleneck. Feel free to close it otherwise.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Loading pages is extremely slow in dev mode in Next.js (30s+ ...
I would recommend to separate the dependencies with devDependencies. like these packages are should be inside devDependencies
Read more >better-sqlite3 - npm
The fastest and simplest library for SQLite3 in Node.js.. Latest version: 8.0.1, last published: a month ago. Start using better-sqlite3 in ...
Read more >Debugging site speed with the Chrome DevTools Network tab
This article explains how to use the DevTools Network tab to debug ... Heavy CPU processing is also a common cause of slow...
Read more >Setup Jest with Vite (featuring SWC) - Blog by hung.dev
First, generate React Typescript project using Vite. · Then, install the main dependency jest : · Install react-testing-library packages: · Exclude ...
Read more >Migrating to React 17 and Fixing the JSX Runtime Error with ...
Remove the jsx pragma /**@jsx jsx*/ from all files · Install @emotion/babel-preset-css-prop as devDependency · Upgrade @emotion/core to 10.1.1.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am experiencing the same issue. Both on initial render and on rerenders. Having to render 3 divs with css prop takes 2.5ms on development and 0.015ms on production.
I’ve tried but I can’t repro this, for this to get fixed (or handled somehow) you’d have to share a repro case, share your environment (versions etc). Closing this for now as no enough information has been shared - but feel free to ask for reopening or just open a new issue if you still suffer from this.