keva-dev / keva-dev/reactif

Diffing issues

Open
#1 1 comment 0 reactions 2 assignees Claimed by @lamngo255 View on GitHub
help wanted
Dominant language
TypeScript
Stars
39
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Array rendering re-paint if append elements to head

Render function:

```html


  • {{ todo }}


```

Unshift on array state will cause repaint entire the `

    ` div:

    ```javascript
    function addTodo() {
    state.todos.unshift(state.text)
    state.text = ''
    }
    ```

    The same will happen for `state.todo[1] = 'Text'` and any other operations on array state.

    How to solve: Use key for each item, improve the diff for arrays

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.