deepsourcestatus / test-repository

Avoid .bind() or local functions in JSX properties JS-0417
Performance
Major
8 months ago8 months old
JSX props should not use arrow functions
 4export default function Home({ title, features }) {
 5  return (
 6    <>
 7      <h1 class="no-unknown-property" font-size="24" onClick={() => console.log('Should not use bind in JSX props')}> 8        {title ? title : `Welcome to DeepSource`}
 9      </h1>
10      <Hero className={'bg'} title='DeepSource is how you write clean and secure code' title=''></Hero>
JSX props should not use arrow functions
 4export default function Home({ title, features }) {
 5  return (
 6    <>
 7      <h1 class="no-unknown-property" font-size="24" onClick={() => console.log('Should not use bind in JSX props')}> 8        {title ? title : `Welcome to DeepSource`}
 9      </h1>
10      <Hero className={'bg'} title='DeepSource is how you write clean and secure code' title=''></Hero>
JSX props should not use arrow functions
 7  }
 8
 9  render() {
10    <div onClick={() => this.handleClick.bind(this)} class={this.props.class_name}>{this.props.title}</div>;11  }
12}
13
JSX props should not use arrow functions
 7  }
 8
 9  render() {
10    <div onClick={() => this.handleClick.bind(this)} class={this.props.class_name}>11      Welcome to {this.props.title} TestingComponent Component
12    </div>
13  }