React Query: It’s Time to Break up with your "Global State”! -Tanner Linsley

Поділитися
Вставка
  • Опубліковано 25 сер 2024

КОМЕНТАРІ • 129

  • @Aaaaaaaaaaaaaaaahhhhhhh
    @Aaaaaaaaaaaaaaaahhhhhhh 4 роки тому +56

    This gentleman is my hero.
    Starting with the separation of states is exactly what has been eating at my sole all this time.

    • @rjmunt
      @rjmunt 4 роки тому +14

      May I suggest some foot ointment ;)

    • @hugodsa89
      @hugodsa89 2 роки тому

      @@rjmunt best comment

  • @makertolentino
    @makertolentino 4 роки тому +111

    This dude is a rockstar

  • @EdwinManual
    @EdwinManual 3 роки тому +6

    This is the library we need. But not the one we deserve. He is a true hero ❤️

  • @fostertheweb
    @fostertheweb 4 роки тому +27

    react-query examples start at 16:08 for anyone coming back for reference

  • @tshddx
    @tshddx 4 роки тому +22

    I’ve checked out React-query before, but this video really sold me on the concept! I’m going to try it out on a new internal tool at work. I would love to see more screencasts covering some of the more advanced features like pagination.

  • @traviswatson6527
    @traviswatson6527 3 роки тому +11

    21:20 I hope I am missing something on this mock server failure, it looks like it corrupted the list (removed Tanner even though Tanner 2 was the one that failed) and lost the user’s changes. Pessimistic me is not impressed with this optimistic mutation.

    • @qorzzz9252
      @qorzzz9252 10 місяців тому

      I also noticed this, seems like rollback not working properly.

    • @user-jr1nd2qe6i
      @user-jr1nd2qe6i Місяць тому

      Or maybe to delete Tanner and get the response back Tanner 2 was already inserted and the initial value deleted?

  • @patrickkaipainen3301
    @patrickkaipainen3301 2 роки тому +1

    The overview of different 'naive' strategies for dealing with async data is actually really great. Going from simple useState/useEffect combo in a component, to a decoupled context module that can handle de-duping

  • @aeronwolfe7072
    @aeronwolfe7072 Рік тому +1

    it took me a while to get used to the way it works, and how to sperate out my api's from my components, but at this point, i would never go back. i absolutely LOVE react-query (tannstack query). it makes it SO easy... and the fact that it's smart about caching, even when I AM NOT, is amazing!!!!!! Thank you Tanner Linsley!!! still using your library!!!

  • @sylviaadamski8191
    @sylviaadamski8191 2 роки тому +1

    Massive thx for React Query :) Been using it for a few weeks now and it is a breeze! React Query is especially useful for devs who focus on the frontend and usability side of things rather than having to deal with complicated React state managers.

  • @amnonsadeh8047
    @amnonsadeh8047 2 роки тому +1

    Bug at 21:20 ? He demonstrates optimistic UI by creating two posts. The second post fails, but when the UI updates to reflect that, it's the first which disappears...

  • @chauvoluuhuong7485
    @chauvoluuhuong7485 Рік тому +1

    For deduping requests why don't you just add to the PostCount component a prop as a number of posts. btw, your presentation about benefit of using react-query is very good

  • @moutonguerrier
    @moutonguerrier 2 роки тому

    12:00 how to de-dupe requests by using a react ref on the Promise
    17:00 react-query in the blog app starts here

  • @mustaflex
    @mustaflex 3 роки тому +1

    "Prop Drilling" such a good way to share the pain of passing down the props to children.

  • @PankajKumar-mv8pd
    @PankajKumar-mv8pd 4 роки тому +6

    Hi Tanner, React query looks very good. Thanks for making this. I have one question related to the normalizing state, suppose I have to add comment section in each post. Earlier we used normalizer for this. How normalizer will fit in React Query state? Do you have any example of that?

  • @piby1802
    @piby1802 4 роки тому +6

    I was just struggling to organize my state in my react native app. Just found your video and the library. May thanks, sir! Could you share link to the code so that we can play with it?

  • @Victor-zg8kq
    @Victor-zg8kq Рік тому

    For future vids, please show the code full screen and shrink the speaker into one of the corners.

  • @TodorPavlov
    @TodorPavlov Рік тому +1

    The topic is interesting but the code is not readable at all - please in the feature when you make videos put the code on full screen and yourself in the lower right part of the screen (by the way I use 56 inch monitor so the problem is not in the monitor size).

    • @ahmedsafwat3488
      @ahmedsafwat3488 3 місяці тому

      also the ads in the bottom is so annoying but great content

  • @RakeshKumarBN
    @RakeshKumarBN 4 роки тому +3

    wow!! looks like react-query is going replace redux as server state management tool in the future but as now they can live side by side together

  • @javascriptduniya1201
    @javascriptduniya1201 2 роки тому +2

    font size is to small. I closed video after trying hard for few minutes

  • @KomarovPavel-if8ud
    @KomarovPavel-if8ud Рік тому

    I think what's missing in this talk is REST. The introduced concept of "server state" was used in two ways: to point out to data persisted beyond client and to point out to a part of "global state". It's an awkward abstraction. I think it's better to use REST language and talk about resources and representations of their state. React-query extends http/rest abstractions into the client app, but most of it already exists! The web is layered by design and same thing that react-query does on client can be done on any layer between a client and a server. In fact there might not even be "the server" you are talking to. With clouds you might deal with clusters and many layers of caching and god only knows where your response comes from. Browser also does caching. So it's more appropriate to talk about resources and representations of their state, it's better to have one language for the whole web layer than to separate frontend and create separate abstractions, it's better to solve problems with the whole stack of web technologies than to think inside frontend JavaScript box. It might be that later on part of the solution would be on the backend and it would push updates to the client instead of client refetching it, or it might be that browsers will build something on top of fetch with similar capabilities to what react-query provides - who knows! And ofc if you use REST language it becomes obvious that all of this relates to a particular way of network communication and that there're other ways like streams, where there're different problems and different solutions. Great presentation though and great technology! I'm two years late with my project plagued by legacy, but I'm glad that I'm catching on)))

  • @richardhulse9328
    @richardhulse9328 4 роки тому +13

    Really, really great video. Please: more editor on screen, and less audio compression on the mic as it makes you sound asthmatic!

  • @bigdogsmallman
    @bigdogsmallman 3 роки тому +1

    get this man a glass of water, he needs and deserves it. He is doing God's work

  • @mKumaranVeera
    @mKumaranVeera 3 роки тому +2

    Sorry, I couldn't continue the video, I can't see the code editor 🧐

  • @mohamedfouedslama3412
    @mohamedfouedslama3412 3 роки тому +1

    just awesome man. used react query as an experiment and it is just super convinient and easy to work with. i am used to use redux at work but now i'm gonna reconsider this decision. keep up the hard work and thanks for this awesome tool.

  • @user-lm5ju8nc2t
    @user-lm5ju8nc2t 2 роки тому +1

    Nice talk, man! It would have been great if you had shared a link to the code.

  • @jimshtepa5423
    @jimshtepa5423 2 роки тому +1

    Thank you for this informative talk and great presentation. I was wondering if the codebase that Tan is using available publicly?

  • @ljuglampa
    @ljuglampa 4 роки тому +1

    This library will (have?) blow tf up. Love it.

  • @mitsukiorichimaru4511
    @mitsukiorichimaru4511 4 роки тому +1

    haha at 18:25 you renamed another post to "tanner" which makes the searched dead post in side bar come to life

  • @lg2389
    @lg2389 4 роки тому +8

    Great talk man! I will look more into react-query and try it out! Def somethings to improve on your talks. Breathing and if you show code, please make your font size higher, but aside from that, the example and how you laid out the talk was great (:

  • @ChrisDieringer
    @ChrisDieringer 4 роки тому +5

    the slide-show? is quite nice. anyone know what toolkit was used to _build_ this presentation?

  • @niallryan209
    @niallryan209 4 роки тому +3

    Great video. Definitely going to start using react query.

  • @jrandiny3
    @jrandiny3 4 роки тому +1

    Wow, I have been searching this for a long time. Long story short, my searching skill let me down. Well it's better late than never

  • @Atif1702
    @Atif1702 2 роки тому

    Unable to see the code at all. 20% of the screen is code editor whereas it should have been on at least 50%.

  • @az1nn
    @az1nn Рік тому

    very good! nice explanation about the motivation of creating react query!

  • @KunalKamble
    @KunalKamble 3 роки тому

    It’s really hard to see your code, you should have made code full screen or increase font size.

  • @heesoolee72
    @heesoolee72 Рік тому

    This video is amazing. Btw his keynote skill is amazing too.

  • @8497715
    @8497715 Рік тому

    What presentation engine do you use? It is visually awesome!

  • @mrwho2513
    @mrwho2513 4 роки тому +10

    12:54 - farting time

  • @zakidev
    @zakidev Рік тому

    Tanner is life saver

  • @zzy8811
    @zzy8811 2 роки тому

    Thank you, a useful intro!

  • @MrChrisk8er
    @MrChrisk8er 2 роки тому

    Hi, can you please share the code? I need to learn it. Thanks

  • @akshayagrawal8130
    @akshayagrawal8130 3 роки тому

    Absolutely amazing..I never knew I needed this. Impressive presentation

  • @shoaibbhimani7831
    @shoaibbhimani7831 4 роки тому +1

    Thanks Tanner Nicely Explained

  • @jbradshaw7
    @jbradshaw7 4 роки тому

    I didn't realise I needed this until I watched - thanks.

  • @jimshtepa5423
    @jimshtepa5423 2 роки тому

    at 11:20 Tanner confirms that implementing a global state and attempting to pass it down the component tree doesn't work. However I didn't full understand the explanation. Can someone please explain why global state didn't resolve the issue related to multiple invokiation of the fetch function?

    • @chetan9533
      @chetan9533 2 роки тому +1

      Because the global state is just a state variable accessible to all components. But where is the logic that actually fires a network request? It's inside a useEffect within our custom hook(usePosts), right?
      Now the custom hook is supposed to be used at multiple places within our app. And the code within custom hook(which includes invoking fetch function) runs as many times as we reuse the custom hook (similar to why code inside a normal function runs as many times as you invoke/call that normal function).
      So code within custom hook running multiple times -> multiple network requests

  • @blank001
    @blank001 2 роки тому

    To me this guy is a Rock star in Tech world.

  • @akeinchina
    @akeinchina 2 роки тому

    Amazing content! Thank you Tanner!

  • @chriszhang3629
    @chriszhang3629 4 роки тому +3

    This is amazing!

  • @mivchal333
    @mivchal333 2 роки тому

    You are React Rockstar!

  • @hitchlander3800
    @hitchlander3800 3 роки тому

    Thank you Tanner . Makes a lot of sense.

  • @braveman4665
    @braveman4665 2 роки тому

    anyone got link for the source?

  • @magnusmarkling
    @magnusmarkling 3 роки тому

    Fantastic presentation!

  • @glendonphilippbaculio1811
    @glendonphilippbaculio1811 3 роки тому

    good for backend operations but i just personally prefer redux for local state management specially with react native, you use react navigation, you know why it's useful there

  • @sergeykahnwald6640
    @sergeykahnwald6640 2 роки тому

    Great job man!

  • @ralexand56
    @ralexand56 4 роки тому +3

    This is freaking amazing!

  • @parrot785
    @parrot785 3 роки тому

    Awesome presentation!

  • @toneyf
    @toneyf 3 роки тому

    will it work with websockets data?

  •  2 роки тому

    This is briliant

  • @thedeveloper4207
    @thedeveloper4207 3 роки тому

    CAN'T SEE THE CODE

  • @ZeeshanAhmad-lq5nc
    @ZeeshanAhmad-lq5nc 3 роки тому

    where i can find this repo?

  • @ricardoespinoza5821
    @ricardoespinoza5821 3 роки тому

    awesome things from tanner as always

  • @tsooooooo
    @tsooooooo 2 роки тому

    Very cool work

  • @pooryaj2092
    @pooryaj2092 4 роки тому +3

    What is this cam-girl size camera, show the code man

  • @RomeoMihalcea
    @RomeoMihalcea Рік тому

    neat stuff - by the time people learn this thing it will already be obsolete.

  • @meandillar69
    @meandillar69 3 роки тому

    Thanks for the great video!

  • @jahadempire7934
    @jahadempire7934 3 роки тому

    Newbs here, if I have a client state, then what state manager I will use?

    • @jahadempire7934
      @jahadempire7934 3 роки тому

      oh, he said @26:00 he used context and useReducer..

  • @pannihto7588
    @pannihto7588 4 роки тому +5

    So basically, this is Apollo Client for REST API

    • @AW-zk4nf
      @AW-zk4nf 3 роки тому +1

      seems like mind blowing to who haven't use react apollo hooks before...

  • @AdrianGonzalezBlogs
    @AdrianGonzalezBlogs 4 роки тому

    This is great!

  • @haroldpepete
    @haroldpepete 2 роки тому

    i need a new eyes after watching this video

  • @rjmunt
    @rjmunt 4 роки тому

    Thanks a lot sir!

  • @galbatorixtheking9779
    @galbatorixtheking9779 3 роки тому

    is this code on github? can someone please share the link for it?

    • @OmkarRajam
      @OmkarRajam 3 роки тому

      Code in vid is here: github.com/tannerlinsley/react-query-blog-refactor-example/commits/master
      Each commit is a stage like in the video. If you're using VScode with Gitlens, it's easy to check out the version of the code at that commit like Tanner does in the video

  • @asyncasync
    @asyncasync 3 роки тому

    People keep mentioning how this is going to replace redux, but for me one of the selling points for redux is the ability to easily keep track of state while debugging using redux devtools. How do I debug this?

    • @babri1402
      @babri1402 3 роки тому

      github.com/tannerlinsley/react-query-devtools
      By using this perhaps?

    • @asyncasync
      @asyncasync 3 роки тому

      @@babri1402 it does not seem to support time travel though and the maintainer closed an issue about it saying he is not planning on implementing this any time soon.

  • @anoopvasudevan
    @anoopvasudevan 3 роки тому

    man this is awesome! would like to know what's happening under the hood

  • @tomasmedina
    @tomasmedina 3 роки тому

    this is exactly what i was looking for to handle my server state!

  • @user-yb2fn4nc8l
    @user-yb2fn4nc8l 4 роки тому +1

    Stop stop stop! Do you wanna say that Dan Abramov was wrong? This cannot be!
    That way the industry will soon discover some advanced features like OOP and maybe even MVC!

    • @tannerlinsley
      @tannerlinsley 4 роки тому +1

      Not sure what this has to do with the content. 🤷‍♂️

  • @Arzen84
    @Arzen84 3 роки тому

    I wish I'd be just half as smart as Tanner :sweaty-smile;

  • @wkencel
    @wkencel 3 роки тому

    Young Jonah Hill makes a badass developer

  • @avi7278
    @avi7278 3 роки тому

    I can't see the difference between this and Apollo Client for React. Unless you were referring to AC as overpowered, because it provides all this functionality and more, like being able to run graph queries on your cache, and observable queries with subscriptions. ReactQuery looks like a pared-down version of Apollo Client.

  • @mitsukiorichimaru4511
    @mitsukiorichimaru4511 4 роки тому

    ua-cam.com/video/seU46c6Jz7E/v-deo.html at 18:13 you have deleted a updated post but you can still see posts title "tanner" found in the sidebar

  • @i-am-the-slime
    @i-am-the-slime 2 роки тому

    How do you look younger than a photo of yourself?

  • @Peter-ur8nv
    @Peter-ur8nv 3 роки тому

    Sadly there is no option to hit like button more than once...

  • @mosespeter9711
    @mosespeter9711 3 роки тому +1

    We really don't need to see your face throughout the video... the code is so tiny and almost invisible because of the screen split between it and your face. Great Concept though

  • @jimbo4728
    @jimbo4728 3 роки тому +3

    this video is unwatchable. I really wanted to watch it but that microphone is way to sensitive, hearing all the breathing and swallowing drives some people insane. less sensitive microphone would be good

  • @yashmalik3037
    @yashmalik3037 4 роки тому +2

    You have such clear mic that your breathing is irritating. I can't focus on what you are saying, I can't go through this. Please drink some water and work on your breathing while recording. I almost threw my laptop after bearing 8 minutes 28 seconds of this video.

  • @LouaiAmrouche-iu9bc
    @LouaiAmrouche-iu9bc 8 місяців тому

    bro fix your docs, they're the worst i've ever seen

  • @hansheng654
    @hansheng654 4 роки тому

    Coming from backend dev and functional programming world, when I first learnt react and concept of redux.. I knew that the frontend dev world is fked..... Global state can be bad, singleton should be avoided... Pure functions only... Those are common ideas among functional programming yet very different in the react world.

    • @omicronx94
      @omicronx94 3 роки тому

      Lol you have no idea what you're talking about. React is in fact centered around pure functions and not using singletons. Why do you think it's called "React" ?

    • @hansheng654
      @hansheng654 3 роки тому

      @@omicronx94 then you have redux ,context API

  • @daniilkonoplev5499
    @daniilkonoplev5499 4 роки тому +3

    "I absolutely love React... and Javascript". Liar. Nobody loves JS :D

  • @MunyaradziRangaIncrease
    @MunyaradziRangaIncrease 3 роки тому

    Math.abs(genius = 1)