|
|
Ае, събирате ли си некви мъдрости дето сте чели най-важното?
Аз ся си прегледах файла и нема нищо особено:
Hooks allow you to reuse stateful logic without changing your component hierarchy
Do two components using the same Hook share state? No. Custom Hooks are a mechanism to reuse stateful logic (such as setting up a subscription and remembering the current value), but every time you use a custom Hook, all state and effects inside of it are fully isolated
Ideally, only your reducer functions and selectors should know the exact state structure, so if you change where some state lives, you would only need to update those two pieces of logic
A reducer lets you decouple expressing the actions that happened in your component from how the state updates in response to them
With classes, function props by themselves aren’t truly a part of the data flow. With useCallback, functions can fully participate in the data flow
When you work with functional programming, all you get is functions forming a pipeline. One function feeds data to the next, which feeds it to the next, and so on until the results you need flow out the end
As is often the case, the hardest thing is to come up with a good name
I have sold less books on sex than Stephen Hawking has on physics -- Madonna
|
| |
|
|
|