Skip to content

Unused var + linting #64

Closed
Closed
@goldylucks

Description

@goldylucks

Isn't passing value enough?

Here:
https://github.com/ReactTraining/react-workshop/blob/13748e43467581c2933dbd878f1cc1aef6a08263/subjects/07-Compound-Components/solution.js#L62-L66

Can do this instead:

  select(value) {
    this.setState({ value }, () => {
      this.props.onChange(value); // no need to do this.state.value
    });
  }

Also having eslint installed would have flagged that value as an unused param.

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