JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q70712F

Package Exports

  • dropdown-odul68
  • dropdown-odul68/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dropdown-odul68) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Dropdown for project 14 Openclassrooms

Dropdown button to use in React.

Install

Run the command :

npm i dropdown-odul68

Import in your file :

import { Dropdown } from "dropdown-odul68"

Usage

export const data =
[
  {
    name: 'John',
  },
  {
    name: 'Marc',
  },
  {
    name: 'Fred',
  }
]

  const [selectedData, setSelectedData] = useState(data[0]);

  function selectValue(e) {
    setSelectedData(e);
  }
<Dropdown selected={selectedData} label="Title" arr={data} field="name" onClick={selectValue} />
;