Snippets

  • autocomplete.tsxshadcn Autocomplete
  • unsavedChanges.tsxReact hook that handles confirmation when quitting a screen that has unfinished work (touched inputs etc.)
  • useLocalStorage.tsReact hook that handle localStorage
  • refetch.tsFunction for refetching
  • verticalMenu.tsVertical menu with vertical text | styled-components
  • Button.tsxUsing rest dot notation (...rest) with React + Typescript
  • useAcordion.tsReact hook for dealing with accordion and auto scrolling. Like the issue that when you open an tray the page height changes and you have to deal with that before scrolling.
  • useScreenSize.tsReact hook to detect screen size
  • useClickOutside.tsReact Hook that handles identifying when is clicked outside of the referenced element
  • filterImageString.jsJavaScript function to get the image file name from a src link
2025 Andrei T.F.
with Next.js