-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Cannot convert a Symbol value to a string #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
显然不可以,都提示你不能把symbol转成string了。dispatch第一个参数必须是字符串。 |
对的,提示是这么提示的,但是感觉这里用Symbol不是挺好的么,为啥要限制String |
有道理。。你可以提一个feature request,记得用英文。。 On Wed, Sep 7, 2016, 19:32 guoerwei [email protected] wrote:
|
Symbol is not supported because it cannot be serialized. See #224, reduxjs/redux#4 |
尝试了在 mutation-types.js 里定义的时候,使用Symbol(),比如SOME_ACTION=Symbol()
在actions里面dispatch会是成功的,
const test = ({dispatch}, action) => { dispatch(SOME_ACTION), action };
但是在非actions里,比如我参考vux,在router那边使用了dispatch来操作。
store.dispatch(SOME_ACTION, param)
这个时候就会报出Cannot convert a Symbol value to a string,如果不用Symbol()就可以
The text was updated successfully, but these errors were encountered: