Skip to content

pushToStdout function changes the state inplaceΒ #904

@impulsgraw

Description

@impulsgraw
pushToStdout = (message, options) => {
  const { stdout } = this.state

  if (this.props.locked) stdout.pop()

  stdout.push({ message, isEcho: options?.isEcho || false })

  /* istanbul ignore next: Covered by interactivity tests */
  if (options?.rawInput) this.pushToHistory(options.rawInput)
  this.setState({ stdout: stdout })
}

Here the state object is being changed inplace, so setState does nothing. Probably it's minor, since I couldn't observe the bug.

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