Skip to content

Commit

Permalink
fix strapi-plugin-content-type-builder (strapi#7521)
Browse files Browse the repository at this point in the history
* Update retrieveComponentsFromSchema.js

~ fixed ReferenceError: Cannot access 'allComponents' before initialization

* strapi-plugin-content-type-builder fix

~ fixed cannot access 'originalIcon' before initialization

Signed-off-by: Garrett Fritz <garrettfritz@garretts-mbp.home>
  • Loading branch information
MoreBlood authored and Garrett Fritz committed Sep 7, 2020
1 parent 6508b4b commit 2c46529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Wrapper from './Wrapper';

const ComponentIconPicker = ({ error, isCreating, label, name, onChange, value }) => {
const { allIcons, allComponentsIconAlreadyTaken } = useDataManager();
const [originalIcon] = useState(value);
const initialIcons = allIcons.filter(ico => {
if (isCreating) {
return !allComponentsIconAlreadyTaken.includes(ico);
Expand All @@ -24,7 +25,6 @@ const ComponentIconPicker = ({ error, isCreating, label, name, onChange, value }
});
const ref = useRef();
const searchWrapperRef = useRef();
const [originalIcon] = useState(value);
const [showSearch, setShowSearch] = useState(false);
const [search, setSearch] = useState('');
const [icons, setIcons] = useState(initialIcons);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const retrieveComponentsFromSchema = (attributes, allComponentsData) => {

return [
...acc2,
...retrieveComponentsFromSchema(compoAttrs, allComponents),
...retrieveComponentsFromSchema(compoAttrs, allComponentsData),
];
},
[]
Expand Down

0 comments on commit 2c46529

Please sign in to comment.