#Type 'Element[]' is not assignable to type 'CollectionElement<object>'

2 messages · Page 1 of 1 (latest)

ripe isle
#

ive tried various ways but none of them seem to be working,

my code:-

<Dropdown.Menu
                  css={{
                    $$dropdownMenuWidth: "340px",
                    $$dropdownItemHeight: "70px",
                    "& .nextui-dropdown-item": {
                      py: "$4",
                      svg: {
                        color: "$error",
                        mr: "$4",
                      },
                      "& .nextui-dropdown-item-content": {
                        w: "100%",
                        fontWeight: "$semibold",
                      },
                    },
                  }}
                >
                  {link.items
                    .filter((item) => !item.onlyIfLoggedIn)
                    .map((item, i) => (
                      <Dropdown.Item key={i} icon={<Icon icon={item.icon} />}>
                        <Link href={item.link} color="inherit">
                          {item.name}
                        </Link>
                      </Dropdown.Item>
                    ))}
                  {session &&
                    link.items
                      .filter((item) => item.onlyIfLoggedIn)
                      .map((item, i) => (
                        <Dropdown.Item key={i} icon={<Icon icon={item.icon} />}>
                          <Link href={item.link} color="inherit">
                            {item.name}
                          </Link>
                        </Dropdown.Item>
                      ))}
                </Dropdown.Menu>

i'ved tried surrounding them with <></> and <div> but did not work, and when i test them in development mode they just render perfectly

vivid tree
#

@oreoreki Any solution?