-
Notifications
You must be signed in to change notification settings - Fork 108
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
Input props remove assign #14
Conversation
这种透传的方式是很蛋疼,最好全都是固定下来的 |
感觉这里 type 直接写死应该也没问题,checkbox 难道 type 还会是其他?style 感觉更加不需要传递了,但不知道会不会有兼容问题,就也写上了。 @yiminghe 看看? |
@@ -84,7 +84,8 @@ export default class Checkbox extends React.Component { | |||
> | |||
<span className={`${prefixCls}-inner`} /> | |||
<input | |||
{...props} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不这样传,如果用户用了 disabled
之类,要一个一个加上去么。。
disabled 处理下, style 处理倒是错误的, style 是在顶层的 |
我感觉都写死很不好,看上面的 issues 这算是老 v8 的 bug。sindresorhus/object-assign#32 针对这些问题搞了一个解决方案。
应该不行,需要 babel 解决,再持续关注吧。 |
这个固定写死也没多少,否则以后 typescript 类型没法写 |
react 官方引入了 object-assign .... |
问题
{...props}
等效于assign({}, props)
。assign 方法在 node 和 浏览器上表现不一致,chrome 最新版本 assign 之后,安装 key 的字母顺序。这会导致浏览器和服务器渲染不一致:
浏览器上相当于
服务端