React version: DevTools version 4.12.2-d14b6a4bdd
Steps To Reproduce
- Use
console.warn from within a React component where the last argument is typeof "symbol"
Link to code example: https://codesandbox.io/s/pedantic-neumann-711ph?file=/src/App.js
The bug only happens when you make a change, so if you use the code sandbox link you need, open a new window, active dev tools, open the React dev tools and then uncomment line 5: // return null only then will the error actually happen.
I've located the culprit to this line of code
https://github.com/facebook/react/blob/0e100ed00fb52cfd107db1d1081ef18fe4b9167f/packages/react-devtools-shared/src/backend/console.js#L146-L147
And would offer the following change
const alreadyHasComponentStack = typeof lastArg === "string" && isStringComponentStack(lastArg);
The current behavior
React DevTools is implicitly converting a Symbol to a string.
The expected behavior
React DevTools does not implicitly try to convert a Symbol to a string.
React version: DevTools version 4.12.2-d14b6a4bdd
Steps To Reproduce
console.warnfrom within a React component where the last argument is typeof"symbol"Link to code example: https://codesandbox.io/s/pedantic-neumann-711ph?file=/src/App.js
The bug only happens when you make a change, so if you use the code sandbox link you need, open a new window, active dev tools, open the React dev tools and then uncomment line 5:
// return nullonly then will the error actually happen.I've located the culprit to this line of code
https://github.com/facebook/react/blob/0e100ed00fb52cfd107db1d1081ef18fe4b9167f/packages/react-devtools-shared/src/backend/console.js#L146-L147
And would offer the following change
The current behavior
React DevTools is implicitly converting a Symbol to a string.
The expected behavior
React DevTools does not implicitly try to convert a Symbol to a string.