Skip to content

Commit

Permalink
Fixed label extraction from the stack traces in node for components w…
Browse files Browse the repository at this point in the history
…rapped in `React.forwardRef` (#1973)

* Improve regex for getting labels on Node.js

* Create six-geckos-battle.md

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
  • Loading branch information
santialbo and Andarist committed Aug 18, 2020
1 parent a836d31 commit 2cf3b16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/six-geckos-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@emotion/core": patch
---

Fixed label extraction from the stack traces in node for components wrapped in `React.forwardRef`. This has affected only development builds.
2 changes: 1 addition & 1 deletion packages/core/src/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const jsx: typeof React.createElement = function(
if (error.stack) {
// chrome
let match = error.stack.match(
/at (?:Object\.|Module\.|)jsx.*\n\s+at ([A-Z][A-Za-z$]+) /
/at (?:Object\.|Module\.|)jsx.*\n\s+at (?:Object\.|)([A-Z][A-Za-z$]+) /
)
if (!match) {
// safari and firefox
Expand Down

0 comments on commit 2cf3b16

Please sign in to comment.