Full Stack Components - Kent C. Dodds, Remix Conf Europe 2022
Вставка
- Опубліковано 3 жов 2024
- Check out FAQ on this content, shortened version and extra resources for this talk at gitnation.com/...
Find the latest React talks & workshops at gitnation.com
Remix Conf Europe 2022 #RemixConfEU #GitNation
Website - remixconf.eu/
Talk: Full Stack Components
In this talk, Kent will demonstrate how Remix enables you to build complex UI components that are connected to a backend in the simplest and most powerful way you've ever seen. Leaving you time to chill with your family or whatever else you do for fun 😎.
This event would not take place without the support of sponsors:
🏆 Platinum Sponsors
Focus Reactive → focusreactive....
🥇 Gold Sponsors
Storyblok → www.storyblok....
🥈 Silver Sponsors
Netlify → www.netlify.com/
Immediately went and implemented this in my current project and wow I love it. Similar use case - had a search combobox using downshift. I was duplicating code on the different pages that used it and I'm very pleased with having that all in one place now. Great, quick demo, thanks!
Thanks, Kent!
I was using already a version of this in my app for a couple of features, but exporting the component from a different place. As you mention in the video, I'm not a fan either of importing anything from routes in my app code, as I see routes as something Remix should handle only.
It could be justified if, being in the same file, the fetcher would know automatically where to submit, but as you also have to manually write that for this to work, I think splitting the route and the component is better. You can still put them in a nice package, keeping the Remix API and your components API separated.
Keep up the good work and good luck with your next project!
Geniously awesome!
Thanks Kent! ☺
Great demo! But how could you forget Nullish Coalescing Operator, which famously rolls right off the tongue? 😁
I’ve always kept components and their loaders separate in /components and /routes/_api respectively.
Should I move all of my route specific components from the components directory into their associated route files, then update the imports to import the comps from their new route file location?
This approach seems awesome but I’d like to stick to best practices. What do you think?
Btw I love remix, and have to say thank you for making it all happen!!
You mentioned a repo. Can you link it please? It's kind of hard to follow
How are we supposed to handle the error in the useFetcher API call? Can anyone help me here
Hey Kent I was trying to get this working but Im getting an error about useFetcher must be used in a data router. Any thoughts that could help me out?
Just figured out that VSCode imported useFetcher from react-router instead of remix. Sorry for the inconvenience
What was that suggesting the code snippet while editing code?
GitHub copilot
@@KentCDodds-vids thanks a lot.