File tree 5 files changed +306
-5
lines changed
5 files changed +306
-5
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ extends : [ 'eslint:recommended' , 'plugin:react/recommended' ] ,
3
+ plugins : [ 'react-hooks' ] ,
4
+ rules : {
5
+ 'react-hooks/rules-of-hooks' : 'error' ,
6
+ 'react-hooks/exhaustive-deps' : 'warn' ,
7
+ 'react/prop-types' : 0 ,
8
+ } ,
9
+ parserOptions : {
10
+ ecmaVersion : 9 ,
11
+ sourceType : 'module' ,
12
+ ecmaFeatures : {
13
+ jsx : true ,
14
+ experimentalObjectRestSpread : true ,
15
+ experimentalArrayRestSpread : true ,
16
+ } ,
17
+ } ,
18
+ env : {
19
+ browser : true ,
20
+ node : true ,
21
+ } ,
22
+ }
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " react-template-empty " ,
2
+ "name" : " react-optimization-hooks " ,
3
3
"version" : " 0.1.0" ,
4
4
"private" : true ,
5
5
"dependencies" : {
6
6
"@testing-library/jest-dom" : " ^4.2.4" ,
7
7
"@testing-library/react" : " ^9.3.2" ,
8
8
"@testing-library/user-event" : " ^7.1.2" ,
9
+ "@welldone-software/why-did-you-render" : " ^4.2.5" ,
9
10
"bootstrap" : " ^4.5.0" ,
11
+ "eslint" : " ^7.4.0" ,
12
+ "eslint-plugin-react" : " ^7.20.3" ,
10
13
"react" : " ^16.13.1" ,
11
14
"react-bootstrap" : " ^1.0.1" ,
12
15
"react-dom" : " ^16.13.1" ,
Original file line number Diff line number Diff line change
1
+ import './wdyr'
2
+
1
3
import React from 'react'
2
4
import ReactDOM from 'react-dom'
3
5
import 'bootstrap/dist/css/bootstrap.min.css'
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ if ( process . env . NODE_ENV === 'development' ) {
4
+ const whyDidYouRender = require ( '@welldone-software/why-did-you-render' )
5
+ whyDidYouRender ( React , {
6
+ trackAllPureComponents : true ,
7
+ } )
8
+ }
You can’t perform that action at this time.
0 commit comments