1
36%
MIT
BuckleScript binding to react-dropdown

This is Bucklescript bindings for react-dropdown.

Install, npm

npm install --save bs-react-dropdown

Setup

Add bs-react-dropdown to bs-depenencies in your bsconfig.json!

{
  /* ... */
  "bs-dependencies": [
    "bs-react-dropdown"
  ],
  /* ... */
}

Dropdown option type

type dropdownOption = {
  label: string,
  value: string,
  className: option(string),
};

Basic usage

open Dropdown;

let component = ReasonReact.statelessComponent(__MODULE__);

let options: dropdownOptions = [|
  {label: "label1", value: "value1", className: Some("class1")},
  {label: "label2", value: "value2", className: Some("class2")},
|];

let make = _children => {
  ...component,
  render: self => {
    <Dropdown options />;
  },
};

Check reducer component example