-
Notifications
You must be signed in to change notification settings - Fork 405
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
用变量的方式传React.Node会让react报错 #22
Comments
这个和 babel-plugin-antd 有关? |
我也不造为啥,就这么神奇。。。去掉插件这个它就听话了。 |
Promise 是因为我的render在一个promise之后,忽略它。。 |
没理解到出错的点在哪里,Alert 是从 antd 里 import 的? 还是因为定义了 message ? 给一个能重现的完整文件代码吧。 |
我找到原因了: import React from 'react';
import { Alert, message } from 'antd';
export default class App extends React.Component {
render() {
const message = (<div><p>Test</p><p>Test</p></div>);
return <Alert message={message} />;
}
} 注意我的局部变量 |
这种情况很难处理,换个名字吧。 |
walk around是可以得,不过应该有个更优雅的办法。。 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
但是如果写成inline的是没问题的。。
The text was updated successfully, but these errors were encountered: