How to use the react-select.components.MenuList function in react-select

To help you get started, we’ve selected a few react-select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strapi / strapi / packages / strapi-plugin-content-type-builder / admin / src / components / ComponentSelect / MultipleMenuList.js View on Github external
(acc, current) => {
      acc[current] = false;

      return acc;
    },
    {}
  );
  const [collapses, setCollapses] = useState(collapsesObject);
  const toggleCollapse = catName => {
    setCollapses(prevState => ({
      ...prevState,
      [catName]: !prevState[catName],
    }));
  };

  const Component = components.MenuList;

  const allComponentsCategory = Object.keys(componentsGroupedByCategory).reduce(
    (acc, current) => {
      const categoryCompos = componentsGroupedByCategory[current].map(compo => {
        return compo.uid;
      });

      acc[current] = categoryCompos;

      return acc;
    },
    {}
  );

  const getCategoryValue = categoryName => {
    const componentsCategory = allComponentsCategory[categoryName];
github strapi / strapi / packages / strapi-plugin-content-type-builder / admin / src / components / ComponentSelect / MenuList.js View on Github external
const MenuList = ({
  selectProps: {
    isAddingAComponentToAnotherComponent,
    name,
    onClickOption,
    refState,
  },
  ...rest
}) => {
  const {
    componentsGroupedByCategory,
    componentsThatHaveOtherComponentInTheirAttributes,
  } = useDataManager();
  const Component = components.MenuList;

  return (
    
      <ul style="{{">
        {Object.keys(componentsGroupedByCategory).map(categoryName =&gt; {
          return (
            <li>
              
              <ul style="{{">
                {componentsGroupedByCategory[categoryName].map(component =&gt; {
                  if (
                    isAddingAComponentToAnotherComponent &amp;&amp;</ul></li></ul>
github vtaits / react-select-async-paginate / packages / react-select-async-paginate / src / async-paginate-base.jsx View on Github external
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import Select, { components as defaultComponents } from 'react-select';

import defaultShouldLoadMore from './default-should-load-more';
import defaultReduceOptions from './default-reduce-options';

import wrapMenuList from './wrap-menu-list';

export const MenuList = wrapMenuList(defaultComponents.MenuList);

const sleep = (ms) => new Promise((resolve) => {
  setTimeout(() => {
    resolve();
  }, ms);
});

class AsyncPaginateBase extends Component {
  constructor(props) {
    super(props);

    const {
      options,
      defaultOptions,
    } = props;