1.0.1 • Published 6 months ago
react-select-menu-valentindft v1.0.1
Select Menu
This is a component for an input list https://www.npmjs.com/package/react-select-menu-valentindft
Prerequisites
This project requires NodeJS and NPM. Node and NPM are really easy to install. Make sure there are install in your device.
Installation
Install the npm package in your project
npm i react-select-menu-valentindft
How to use it
Import
import { SelectMenu } from 'react-select-menu-valentindft';
Component
// data is the data you want to list inside the input
// you can add an id to the input
// inputValue is the input value selected
<SelectMenu data={myData} id='some id' inputValue={valueSelectMenuMyData} />
Inject Data
// The structure of your data need to be an array of object with key name
const myData: Array<object> = [
{
name: 'First value'
},
{
name: 'Second value'
},
{
name: 'Third value'
}
]
Input value
let stateInput: string;
const valueSelectMenuMyData = (value: string) => {
stateInput = value;
};