Sephirosu / figma-next-tailwind

https://figma-next-tailwind.vercel.app
0 stars 0 forks source link

Extract this piece of code and create a "custom react hook" #12

Closed mSenad closed 1 month ago

mSenad commented 1 month ago

https://github.com/Sephirosu/figma-next-tailwind/blob/5c2265816c9ba4c67ab547a2f2959df413e0d4d8/src/components/Search/SearchAll.tsx#L8-L20

The reason for this is that this is a utility function whose logic could be re-used throughout the whole application.

Reference: https://react.dev/learn/reusing-logic-with-custom-hooks

Sephirosu commented 1 month ago

Done.Also made hooks folder and put hoook that is reusable.