From 0187ff2b599cc05dfe5f4697af8725e7f8238848 Mon Sep 17 00:00:00 2001 From: AWolf81 Date: Fri, 10 May 2019 07:30:48 +0200 Subject: [PATCH] add react hooks section --- docs/code_style.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/code_style.md b/docs/code_style.md index d8f458d77..c0416216d 100644 --- a/docs/code_style.md +++ b/docs/code_style.md @@ -79,4 +79,11 @@ class MyComponent extends React.Component { // code goes here... } } -``` \ No newline at end of file +``` + +## React Hooks +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. + +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. + +Read more about hooks in the [React hooks introduction](https://reactjs.org/docs/hooks-intro.html).