File tree 2 files changed +21
-1
lines changed
packages/demo-react/src/components
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Hello extends Component<Props> {
14
14
}
15
15
render ( ) {
16
16
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' ) } >
18
18
{ this . isTitleAvailable ? this . title : `Welcome to DeepSource` }
19
19
</ h1 >
20
20
) ;
You can’t perform that action at this time.
0 commit comments