Комментарии:
honestly, this was far more useful than any other video i've seen on useeffect or custom hooks. Props (hehe) to you!
ОтветитьHonestly great tutorial
Ответитьnice work!
ОтветитьLife saver video... even react documentation doesnt have this perfect way of custom Hooks with state inside to share multiple functions at once. Impressive!
Ответитьdo a video on using hooks to substitute hocs
Ответитьawesome
ОтветитьGreat Video. Thanks.
Ответитьas little as it might seem, can you always upload these codes, they will be very helpful.
Ответитьbro, this tutorial was awesome!!
ОтветитьWow!!! This video is a life saver man!!! Thank you for putting this up.
ОтветитьStill, very helpful. Thank you.
Ответитьwhat if I need to set a value both in the custom hook and the component where it's used?
I'm creating a custom hook for two components (a grocery list and a pantry list) that use the same logic for when an ingredient is edited.
part of this logic is setting the editing ingredient and the id of the ingredient processing (setEditingIngredient and setIngredientIdProcessing). Now, there are also needed inside each component (groceryList and Pantry), within logics that are not shared between them. For example, you can mark ingredients as checked (taken) in groceryList but not in Pantry.
how would I handle that?
Thanks