mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-12 17:26:17 +00:00
add react hooks section
This commit is contained in:
@@ -79,4 +79,11 @@ class MyComponent extends React.Component {
|
|||||||
// code goes here...
|
// 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).
|
||||||
|
|||||||
Reference in New Issue
Block a user