question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSX pragma slow in dev mode

See original GitHub issue

Current 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:

image

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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
itsUndefinedcommented, Mar 21, 2021

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.

0reactions
Andaristcommented, Oct 25, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found