-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Bugfix] Fix passing invalid props to dom element #269
[Bugfix] Fix passing invalid props to dom element #269
Conversation
@@ -0,0 +1,5 @@ | |||
import omit from 'lodash.omit'; | |||
|
|||
export default function getRemainingProps(props, Component) { |
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.
覺得這邊可以直接傳 propTypes 進去就好
export default function getRemainingProps(props, Component) { | |
export default function getRemainingProps(props, componentPropTypes) { |
const { innerValue } = this.state; | ||
|
||
const inputValue = this.isControlled() ? value : innerValue; | ||
const isLoading = this.context.status === STATUS_CODE.LOADING; | ||
const rootClassName = classNames(className, `${BEM.root}`); | ||
|
||
const wrapperProps = getRemainingProps(this.props, SearchInput.propTypes); |
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.
不然這邊也是傳錯XD
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.
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.
Purpose
lodash.omit
的 dependency。抽出了getRemainingProps
的 utility。<Text>
story 中噴出來的 error message,起因於錯誤的 import<StatusIcon>
Changes
Risk
Usually none, if you have any please write it here.
TODOs