Skip to content

Commit

Permalink
add react hooks section
Browse files Browse the repository at this point in the history
  • Loading branch information
AWolf81 authored and Rokt33r committed May 13, 2019
1 parent 9a6ee9d commit 1601292
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/code_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,11 @@ class MyComponent extends React.Component {
// code goes here...
}
}
```
```

## 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).

0 comments on commit 1601292

Please sign in to comment.