nandorojo / zeego

Menus for React (Native) done right.
https://zeego.dev
MIT License
1.45k stars 42 forks source link

Conditional items mess with keys #3

Closed nandorojo closed 2 years ago

nandorojo commented 2 years ago

I'm getting a weird error. If, inside of <DropdownMenu.Content>, I have an item that is conditionally rendered, I get an error that my item keys aren't stable. This breaks it:

<Dropdown.Content>
  <Dropdown.Item key="one" />
  {false}
</Dropdown.Content>

I think it also breaks if there is an array rendered alongside a single item:

<Dropdown.Content>
  {items.map(item => <Dropdown.Item key={item} />)}
  <Dropdown.Item key="another-item" />
</Dropdown.Content>

Getting this issue on ios, will have to debug tomorrow.

nandorojo commented 2 years ago

Fixed in 0.1.0-alpha.0.