This repository has been archived by the owner on Dec 16, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 148
auto alias className to class will make props trustless #422
Labels
Comments
cc @developit |
paranoidjk
changed the title
auto alias className to class will makes props trustless
auto alias className to class will make props trustless
Sep 7, 2017
paranoidjk
added a commit
to ant-design/ant-design-mobile
that referenced
this issue
Sep 7, 2017
What if we made it non-enumerable? |
@developit It probably ok. Since we normally won't access But i am not sure it will be 100% safe. So i think there is a tradeoff. IMO, i suggest preact-compat avoid to pollute users component props object in runtime, it's a little dangerous. |
lixiaoyang1992
pushed a commit
to lixiaoyang1992/ant-design-mobile
that referenced
this issue
Apr 26, 2018
I'm unable to reproduce the described issue with Preact X anymore 🎉 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Reproducible demo: https://codepen.io/paranoidjk/pen/MvdLpd
This is caused by #412, it breaks our code base, please revert it.
The reason is preact-compat add a extra alias attribute
class
to component props when it hasclassName
attribute.But in some case, we will want to omit
className
and pass rest props to child component, in this case, child component will got a unexpected class attribute.I think preact-compat can not require users to delete
class
andfor
when they want to omitclassName
,htmlFor
, sincepreact-compat
goal is to compatibility with react but no need to change users code when they want to switch form react to preact.The text was updated successfully, but these errors were encountered: