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

---
title: Best TkDodo posts of 2022 | daily.dev
description: The most upvoted TkDodo posts of 2022, curated by the daily.dev community.
canonical: https://daily.dev/sources/tkdodo/best-of/2022
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/tkdodo/best-of/2022
og:type: website
og:site_name: daily.dev
og:title: Best TkDodo posts of 2022 | daily.dev
og:description: The most upvoted TkDodo posts of 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 TkDodo — 2022

1. 1  
[](/posts/react-query-meets-react-router-2t-gx1h5m "React Query meets React Router")  
[![Dominik D's profile](https://avatars.githubusercontent.com/u/1021430?v=4&s=64)](https://daily.dev/tkdodo)  
[![tkdodo's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1656338366/logos/tkdodo)](/sources/[source]/best-of/[year])  
12m read time • Aug 28, 2022  
### React Query meets React Router  
React Router will allow you to define loaders on each route, which will be called when the route is visited. In the route component itself, you can use loaderData() to get access to that data. If you navigate to contacts/1, data for that contact will be fetched before the component is rendered. This is awesome as it not only improves the user experience, but look at that developer experience of co-located data fetching and rendering.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/f2c98725e295cd9c421a13554f0235b6)  
104  
4
2. 2  
[](/posts/avoiding-useeffect-with-callback-refs-cf-gaetkg "Avoiding useEffect with callback refs")  
[![Dominik D's profile](https://avatars.githubusercontent.com/u/1021430?v=4&s=64)](https://daily.dev/tkdodo)  
[![tkdodo's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1656338366/logos/tkdodo)](/sources/[source]/best-of/[year])  
8m read time • Aug 14, 2022  
### Avoiding useEffect with callback refs  
Ref is a reserved property on build-in primitives, where React will store the DOM node after it was rendered. It will be set back to null when the component is unmounted. The linter won't complain about adding it to the dependency array, and the ref is also not read during render. The effect will run once "on mount" (twice in strict mode. If the react element unmounts, it will be called once more. The react element is called once again. The reaction element was called once further. The ref is called again. It will also be called as an argument.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/94e3f196591ed6369cc54e6dd628572e)  
96  
3

[See all TkDodo archives](/sources/tkdodo/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/tkdodo/best-of/2022#page","url":"https://daily.dev/sources/tkdodo/best-of/2022","name":"Best TkDodo Posts of 2022","description":"The most upvoted TkDodo posts of 2022, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/tkdodo/best-of/2022#items","numberOfItems":2,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/react-query-meets-react-router-2t-gx1h5m","name":"React Query meets React Router"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/avoiding-useeffect-with-callback-refs-cf-gaetkg","name":"Avoiding useEffect with callback refs"}]},{"@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":"TkDodo","item":"https://daily.dev/sources/tkdodo"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/tkdodo/best-of"},{"@type":"ListItem","position":5,"name":"2022"}]}]}
```

