react-cursor-dropdown
A React HOC for adding cursor dropdown menus to textareas and inputs - Try it out!
Install
npm install --save react-cursor-dropdown
Usage
import React Component from "react"; import WithCursorDropdown CursorDropdown from "react-cursor-dropdown"; // Import the component you want to dropdown from the cursorimport SomeListComponent from "SomeListComponent"; const Input = <input />;const InputWithCursorDropdown = ; { ; thisstate = value: "" ; this { this; }; this { // Do something with the value from the dropdown }; } { return <InputWithCursorDropdown = = = > // Specify the regex to match against the current word (capture group required <CursorDropdown = = /> </InputWithCursorDropdown> ); }
License
MIT © danrpts