alibaba / alibaba/rax

[BUG] child node shouldn't update with the number of children changed

Open
#2,147 1 comment 0 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
8k
Forks
611
PR merge metrics
No merged PRs in 30d

Description

```jsx
import { createElement, useState } from 'rax';

function Child() {
console.log('Child render');
return

Child
;
}

function Parent() {
const [arr, setArr] = useState([1]);

return (<>

{ setArr([1, 2]); }}>Click

{arr.map(item => )}
);
}
```

Contributor guide

Open the contributing guide

Research direction

Start by running the JSX reproduction in the issue and observe the Child render logs before and after clicking the div. Trace the rendering path for the keyed children; done means adding a child does not rerender the existing Child component.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.