diff --git a/src/components/ParserOpenRPC/CollapseBox/CollapseBox.tsx b/src/components/ParserOpenRPC/CollapseBox/CollapseBox.tsx index 0cb4a1e776..556d927c72 100644 --- a/src/components/ParserOpenRPC/CollapseBox/CollapseBox.tsx +++ b/src/components/ParserOpenRPC/CollapseBox/CollapseBox.tsx @@ -14,14 +14,12 @@ interface CollapseBoxProps { export const CollapseBox = ({ children, - isInitCollapsed = false, + isInitCollapsed = true, }: CollapseBoxProps) => { - const { collapsed, toggleCollapsed } = useCollapsible({ initialState: true }); + const { collapsed, setCollapsed } = useCollapsible({ initialState: isInitCollapsed }); const { colorMode } = useColorMode(); useEffect(() => { - if (isInitCollapsed) { - toggleCollapsed(); - } + setCollapsed(isInitCollapsed); }, [isInitCollapsed]); return (
setCollapsed((expanded) => !expanded)} > {collapsed ? "Show child attributes" : "Hide child attributes"}
{ description={item.description || item.title || ""} />
- + <> {Object.entries(item.properties).map(([key, value]) => (