Skip to content

Commit 1601292

Browse files
AWolf81Rokt33r
authored andcommitted
add react hooks section
1 parent 9a6ee9d commit 1601292

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/code_style.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,11 @@ class MyComponent extends React.Component {
7979
// code goes here...
8080
}
8181
}
82-
```
82+
```
83+
84+
## React Hooks
85+
Existing code will be kept class-based and will only be changed to functional components with hooks if it improves readability or makes things more reusable.
86+
87+
For new components it's OK to use hooks with functional components but don't mix hooks & class-based components within a feature - just for code style / readability reasons.
88+
89+
Read more about hooks in the [React hooks introduction](https://reactjs.org/docs/hooks-intro.html).

0 commit comments

Comments
 (0)