Skip to content

Function used in a React class component is declared unused. #26

Description

@etedeschini

In the case of a simple React class component with a callback function,
the engine fails to accurately detect the usage of a callback function.

import React from 'react'

export default class MyComponent extends React.Component {
  render () {
    return (
        <input type="checkbox" value={this.props.value} 
             onChange={this._onChange} />
    )
  }

  _onChange = (event) => {
    this.props.change(event)
  }

In the log, I found that the _onChange function is not called, but that’s not true.
📁 src/.... MyComponent.react.js (3 items):
⚡ function _onChange:27

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