While developing react application I would occasionally run into
TypeError: Cannot convert a Symbol value to a string.
This happened when I tried to log react component to console inside jasmine test.
Fortunately where is a simple workaround.
It looks like a lot of typing but the simple solution to this is to create snippet.
Almost every popular editor has a concept of snippets and if yours doesn’t it might be time to change editor.
Here is an example on how to setup snippet in Atom.
In the menu select
File -> Snippets. snippets.cson file will be opened. Add following block of code:
Now if you want to log something with
JSON.stringify it will be only few keystrokes away.