Skip to content

[Bug]: Dynamic key on <list-item> with spread attributes causes illegal item-key error #1920

@gaoachao

Description

@gaoachao

System Info

N/A

Details

When using a dynamic key on <list-item> along with spread attributes, the following native error occurs:

Native error:
code: 220201
message: Error for illegal list item-key in parse insert with indexes: [0, ]
fix_suggestion: Please check the legality of the item-key.

Reproduction

const App = () => {
  const [dynamicKey, setDynamicKey] = useState('key-1');

  useEffect(() => {
    setTimeout(() => {
      setDynamicKey('key-2');
    }, 1000);
  }, []);

  return (
    <list>
      <list-item
        item-key='hello-world'
        key={dynamicKey}
        {...{ 'estimated-height-px': '10px' }}
      >
        <text>123</text>
      </list-item>
    </list>
  );
};```

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions