Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Propertyselected should includePropTypes.number to allow integer values #1625

Open
@ADTC

Description

@ADTC

constSelectedPropType=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)])

Please allowPropTypes.number here. Sometimes the value is numeric - quite common when display label is a string, but internal value is an int.

Although the application works, this throws error in the console.

Warning: Failed prop type: Invalid prop `selected` supplied to `SelectMenu`, expected one of type [string].SelectMenu@webpack-internal:///./node_modules/evergreen-ui/esm/select-menu/src/SelectMenu.js:39:15▽ React 6        printWarning        error        checkPropTypes        validatePropTypes        jsxWithValidation        jsxWithValidationDynamic

Right now I'm overriding the propTypes to fix the error:

SelectMenu.propTypes={  ...SelectMenu.propTypes,selected:PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string),PropTypes.number,]),};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp