Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(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];
const MenuList = ({
selectProps: {
isAddingAComponentToAnotherComponent,
name,
onClickOption,
refState,
},
...rest
}) => {
const {
componentsGroupedByCategory,
componentsThatHaveOtherComponentInTheirAttributes,
} = useDataManager();
const Component = components.MenuList;
return (
<ul style="{{">
{Object.keys(componentsGroupedByCategory).map(categoryName => {
return (
<li>
<ul style="{{">
{componentsGroupedByCategory[categoryName].map(component => {
if (
isAddingAComponentToAnotherComponent &&</ul></li></ul>
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;