Non-string action types are reported `<UNDEFINED>`
See original GitHub issueYou can use anything as an action type, but it seems like only strings are logged properly.
For example if you have LOAD_USER = Symbol('load user');
and then dispatch({ type: LOAD_USER })
, it will log the action as <UNDEFINED>
.
The action type should be logged as String(action.type)
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Action.type undefined error in Redux Reducer - Stack Overflow
I noticed my mapDispatchToProps was written kinda strange so I fixed that, but I still get the error actions is undefined if I...
Read more >createAction - Redux Toolkit
Non-String Action Types . In principle, Redux lets you use any kind of value as an action type. Instead of strings, you could...
Read more >Found template literal expression having a non-string type
Found template literal expression having a non-string type JS-0378. Anti-pattern ... Invalid type "string | undefined" of template literal expression.
Read more >String.prototype.toUpperCase() - JavaScript - MDN Web Docs
The toUpperCase() method returns the calling string value converted to uppercase (the value will be converted to a string if it isn't one)....
Read more >Code Inspections in PHP | PhpStorm Documentation - JetBrains
Commonly, such loops are intended to perform an action only on their first ... Reports the parameters in function calls whose types are...
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
Use
serialize
parameter for that:See API docs for more details.
I actually was trying to do the way you suggested in
redux-devtools-instrument
, but that was causing issues when recomputing actions.I’m having a similar issue, but some of my Symbol action types are being logged.
We have passed serialize as an option:
Any ideas on what might cause this? 😃