allow key to be string or number

This commit is contained in:
Andre Landgraf 2019-06-17 19:50:12 +02:00
parent cdfa4c5124
commit 2f29e099c6
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "react-datalist-input",
"version": "1.1.27",
"version": "1.1.28",
"description": "This package provides a react component as follows: an input field with a drop down menu to pick a possible option based on the current input.",
"main": "./lib/DataListInput.js",
"license": "MIT",

View File

@ -297,7 +297,10 @@ DataListInput.propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape( {
label: PropTypes.string.isRequired,
key: PropTypes.number.isRequired,
key: PropTypes.oneOfType(
PropTypes.string,
PropTypes.number,
).isRequired,
} ),
).isRequired,
placeholder: PropTypes.string,