Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
rtcoder committed May 4, 2023
1 parent bf8dab9 commit 27becff
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/construction/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function Accordion(props: Props) {
console.log(AccordionItem.name)
return (Array.isArray(props.children) ? props.children : [props.children])
.flat()
.filter((child) => child?.type?.displayName === 'AccordionItem');
.filter((child) => child?.type?.name === AccordionItem.name);
}

const [openedItem, setOpenedItem] = useState(
Expand Down
4 changes: 1 addition & 3 deletions src/components/construction/Accordion/AccordionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface AccordionItemInterface {
onOpen?: () => void;
}

const AccordionItem = function AccordionItem(props: AccordionItemInterface) {
export default function AccordionItem(props: AccordionItemInterface) {
const contentRef = useRef(null);
const panelRef = useRef(null);
const [isOpen, setIsOpen] = useState(props.opened || false);
Expand Down Expand Up @@ -66,5 +66,3 @@ const AccordionItem = function AccordionItem(props: AccordionItemInterface) {
</div>
)
}
AccordionItem.displayName = 'AccordionItem';
export default AccordionItem;
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function ButtonToggleGroup(props: Props) {
const getChildrenButtons = () => {
return props.children
.flat()
.filter((child) => child?.type.name === 'ButtonToggle');
.filter((child) => child?.type.name === ButtonToggle.name);
}
const getPropsValue = (): Value[] | undefined => {
if (props.value === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/construction/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Select = forwardRef(function (props: SelectProps, ref: ForwardedRef<HTMLSe
const getChildrenOptions = () => {
return props.children
.flat()
.filter((child) => child?.type.name === 'Option');
.filter((child) => child?.type.name === Option.name);
}
const getOptions = () => {
return getChildrenOptions()
Expand Down

1 comment on commit 27becff

@vercel
Copy link

@vercel vercel bot commented on 27becff May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

website-creator – ./

website-creator-dawidjez.vercel.app
website-creator.vercel.app
website-creator-git-main-dawidjez.vercel.app

Please sign in to comment.