Skip to content

Enhance handling of improper hasError return value for useFormFieldProps #1876

Open
@sungik-choi

Description

Description

Enhance handling of improper hasError return value for useFormFieldProps

Reasons for suggestion

  • useFormFieldProps 는 Form component props를 매개변수로 하여 aria attribute와 disabled, readonly 같은 form field의 속성들을 반환하는 훅입니다.
  • 여기서 hasError 는 올바른 html attribute가 아니므로, 다른 속성들과 다르게 html node에 직접 주입되면 안됩니다. 따라서 아래처럼 객체에서 제외해줘야하는데, 사용성이 많이 떨어지고 실수할 여지가 있습니다.
const { hasError, ...ownProps } = useFormFieldProps(rest)
return (
  <input {...ownProps} />
)

Proposed solution

잘 처리할 수 있는 방법을 모색해보기.

References

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementIssues or PR related to making existing features better

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions