Skip to content

Checked attribute not realizing in DOM #3005

Closed
@colindresj

Description

@colindresj

Recently updated to 0.12.2 and a checkbox element hooked up to this.props is dynamically updating in the browser. Using the React inspector for Chrome, this.props.item.isActive seems to be toggling fine, but for some reason the changes don't propagate into the DOM. Not sure if this is specific to the update, or I've messed something up that I don't realize.

Here's my render function:

render: function() {
  let className = '';
  if (this.props.item.isActive) className = 'is-active';

  return (
    <li className={className}>
      <div className="view">
        <input
          className="toggle"
          type="checkbox"
          checked={this.props.item.isActive}
          onChange={this.toggleActive}
        />
        <span>{this.props.item.text}</span>
        <button className="destroy-item" onClick={this.destroyItem}></button>
      </div>
    </li>
  );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions