<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/robinwieruch/best-of/2022/04" -->

---
title: Best Robin Wieruch posts — April 2022 | daily.dev
description: The most upvoted Robin Wieruch posts from April 2022, curated by the daily.dev community.
canonical: https://daily.dev/sources/robinwieruch/best-of/2022/04
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/robinwieruch/best-of/2022/04
og:type: website
og:site_name: daily.dev
og:title: Best Robin Wieruch posts — April 2022 | daily.dev
og:description: The most upvoted Robin Wieruch posts from April 2022, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of Robin Wieruch — April 2022

1. 1  
[](https://daily.dev/posts/react-hook-uselocalstorage-x-timbmxp "React Hook: useLocalStorage")  
Article  
![Avatar of robinwieruch](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/0e34f790e35d4c21983b8e9512a8cc7f)Robin Wieruch · 4y  
React Hook: useLocalStorage  
A neat custom React Hook that shows how to use local storage in React to store state. You can just use it in any React component and it allows you to write and read state. The hook is only there as a learning experience though. If you rely on the local storage for your React application in production, you should check out more widely used hooks.  
27  
2
2. 2  
[](https://daily.dev/posts/react-hook-detect-click-outside-of-component-umgypipqe "React Hook: Detect Click outside of Component")  
Article  
![Avatar of robinwieruch](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/0e34f790e35d4c21983b8e9512a8cc7f)Robin Wieruch · 4y  
React Hook: Detect Click outside of Component  
A tutorial about how to detect a click outside of a React component by creating a custom React hook for it. For example, you may want such custom React Hook for various components like a dialog or dropdown, because they should close when a user clicks outside of them. Much of what you will learn here goes back to the concept of event bubbling and capturing in JavaScript.  
27  
1

[See all Robin Wieruch archives](/sources/robinwieruch/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/robinwieruch/best-of/2022/04#page","url":"https://daily.dev/sources/robinwieruch/best-of/2022/04","name":"Best Robin Wieruch Posts — April 2022","description":"The most upvoted Robin Wieruch posts from April 2022, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/robinwieruch/best-of/2022/04#items","numberOfItems":2,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/react-hook-uselocalstorage-x-timbmxp","name":"React Hook: useLocalStorage"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/react-hook-detect-click-outside-of-component-umgypipqe","name":"React Hook: Detect Click outside of Component"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"Robin Wieruch","item":"https://daily.dev/sources/robinwieruch"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/robinwieruch/best-of"},{"@type":"ListItem","position":5,"name":"April 2022"}]}]}
```

