Skip to content

Commit 5df378c

Browse files
Add JS-0417 issues
Signed-off-by: Moulik Aggarwal <[email protected]>
1 parent 51906e8 commit 5df378c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from "react";
2+
import propTypes from 'prop-types'
3+
4+
class TestingComponent extends React.Component {
5+
6+
handleClick(){
7+
console.log('We must not use bind in JSX props')
8+
9+
}
10+
11+
render() {
12+
<div onClick={() => this.handleClick.bind(this)} class={this.props.class_name}>Welcome to {this.props.title} TestingComponent Component</div>;
13+
}
14+
}
15+
16+
TestingComponent.propTypes = {
17+
title: propTypes.string.isRequired
18+
};
19+
20+
export default TestingComponent;

packages/demo-react/src/components/home.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Hello extends Component<Props> {
1414
}
1515
render() {
1616
return (
17-
<h1 class="no-unknown-property" font-size="24">
17+
<h1 class="no-unknown-property" font-size="24" onClick={() => console.log('Should not use bind in JSX props')}>
1818
{this.isTitleAvailable ? this.title : `Welcome to DeepSource`}
1919
</h1>
2020
);

0 commit comments

Comments
 (0)