Skip to content

Mutating array #20

@mabarm

Description

@mabarm

/*
if (gameState[itemNumber] === 'empty') {
gameState[itemNumber] = isCross ? 'cross': 'circle'
setIsCross(!isCross)
}
*/
Isn't mutating the array which is a state violates the principles of react.
https://react.dev/learn/updating-arrays-in-state

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions