Skip to content

assignment for jsx in double circulation #11476

@tageecc

Description

@tageecc

Do you want to request a feature or report a bug?
bug,maybe~

What is the current behavior?

  • the code is :
import React, { Component } from 'react';

class App extends Component {

    render() {

        let res = new Array(2).fill(new Array(2));
        for(let i =0;i<2;i++){
            for(let j=0;j<2;j++){
                console.log(res[i][j]);
                res[i][j]=<div>{'i:'+i+',j:'+j}</div>;
            }
        }
        return res;
    }
}

export default App;
  • and the result print on the page is:

image

What is the expected behavior?
it's very strange, i should not start with 0?

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

"dependencies": {
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "react-scripts": "1.0.17"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions