@brainylab/react-select-utils
v1.1.15
Published
React Select Utils
Downloads
1
Maintainers
Readme
React Select Utils
Package with utilities for the react-select package
Installation
Use the npm to install
npm install @brainylab/react-select-utils
Or use the yarn to install
yarn add @brainylab/react-select-utils
Usage
import { arrayConvert } from '@brainylab/react-select-utils'
const array = [
{
id: 1,
name: 'device',
ip: '10.0.0.1'
}
{
id: 2,
name: 'device-2',
ip: '10.0.0.2'
}
]
const arrayConverted = arrayConvert({ array, arrayLabel: "name", arrayValue: "id" })
console.log(arrayConverted)
// return
// [
// {
// label: 'device',
// value: '1'
// }
// {
// label: 'device-2',
// value: '2'
// }
// ]