- {
- plugin && plugin.profile.name !== 'filePanel' && (
-
{plugin?.profile?.maintainedBy?.toLowerCase() === 'remix' ? (
}>
@@ -75,13 +62,22 @@ const RemixUIPanelHeader = (props: RemixPanelProps) => {
{
plugin && plugin.profile.name !== 'filePanel' && (
-
-
- }>
-
-
-
-
+ <>
+
+
+ }>
+
+
+
+
+
+
+ }>
+
+
+
+
+ >
)
}
diff --git a/libs/remix-ui/panel/src/lib/plugins/panel-plugin.tsx b/libs/remix-ui/panel/src/lib/plugins/panel-plugin.tsx
index fa6760dc08..7996bb6b46 100644
--- a/libs/remix-ui/panel/src/lib/plugins/panel-plugin.tsx
+++ b/libs/remix-ui/panel/src/lib/plugins/panel-plugin.tsx
@@ -19,9 +19,12 @@ const RemixUIPanelPlugin = (props: panelPLuginProps, panelRef: any) => {
let view = props.pluginRecord.view
if (props.initialState) {
+ let hasInitialProps = false
+
view = React.Children.map((props.pluginRecord.view.props as any).children, child => {
- if (React.isValidElement(child) && typeof child.type === 'function') {
- // Safe to clone and pass `initialState`
+ if (React.isValidElement(child) && typeof child.type === 'function' && !hasInitialProps) {
+ hasInitialProps = true
+ // Safe to clone and pass `initialState`
return React.cloneElement(child, { ...props, initialState: props.initialState } as any)
}
return child