First steps with custom code components - cannot read properties of undefined (reading map)

Hey! I’m trying to use a custom sidenav component and getting “cannot read properties of undefined (reading map)” when pasting the component in the studio.

It’s a nextjs app with daisy ui installed:
this is the sidenav code:

import Image from "next/image";

interface MenuItem {
    title: string;
    items: string[];

interface SidenavProps {
    menuItems: MenuItem[];
    logoSrc: string;
    logoAlt: string;
    logoWidth: number;
    logoHeight: number;

export default function  Sidenav({ menuItems, logoSrc, logoAlt, logoWidth, logoHeight }:SidenavProps) {
    return (
        <aside className="drawer-side z-10">
            <label htmlFor="my-drawer" className="drawer-overlay"></label>
            <nav className="flex min-h-screen w-72 flex-col gap-2 overflow-y-auto bg-primary px-6 py-1">
                <div className="mx-4 flex items-center gap-2 font-black">
                        sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
                <ul className="menu text-base-100">
                    {, index) => (
                        <li key={index} className="pt-2">
                                    {/* SVG icon can be added here */}
                                    {, itemIndex) => (
                                        <li key={itemIndex}><a>{item}</a></li>

this is the registration code:

import * as React from 'react';
import { PlasmicCanvasHost, registerComponent } from '@plasmicapp/react-web/lib/host';
import  Sidenav from '../components/Sidenav';

registerComponent(Sidenav, {
  name: 'Sidenav',

  props: {
    menuItems: {
      type: 'array',
      // Additional metadata for menuItems can be specified here
    logoSrc: 'string',
    logoAlt: 'string',
    logoWidth: 'number',
    logoHeight: 'number'
  importPath: './path/to/Sidenav' // Adjust the import path based on your project structure

export default function PlasmicHost() {
  return <PlasmicCanvasHost />;

Any suggestions, what am I missing regarding map?

Hi, I believe you are missing a defaultValue for your menuItems, you can set it with defaultValue: [], you can see an example in