Skip to content
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

Merged
merged 6 commits into from
Jun 5, 2020

Conversation

chenesan
Copy link
Contributor

@chenesan chenesan commented Jun 4, 2020

Purpose

Changes

  • a list of what have been done
  • maybe some code change

Risk

Usually none, if you have any please write it here.

TODOs

  • Describe what should be done outside of this PR
  • Maybe in other PRs or some manual actions.

@chenesan chenesan self-assigned this Jun 4, 2020
@chenesan chenesan added bug dependencies Pull requests that update a dependency file labels Jun 4, 2020
@@ -0,0 +1,5 @@
import omit from 'lodash.omit';

export default function getRemainingProps(props, Component) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

覺得這邊可以直接傳 propTypes 進去就好

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不然這邊也是傳錯XD

Copy link
Contributor

@zhusee2 zhusee2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@kyoyadmoon kyoyadmoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chenesan chenesan merged commit 0129a84 into develop Jun 5, 2020
@chenesan chenesan deleted the bugfix/fix-passing-invalid-props-to-dom-element branch June 5, 2020 05:13
@chenesan chenesan mentioned this pull request Jun 5, 2020
2 tasks
@chenesan chenesan mentioned this pull request Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants