Тёмный
No video :(

Using React 19 with Vite and Next.js 

Vercel
Подписаться 86 тыс.
Просмотров 28 тыс.
50% 1

Learn about the latest features of React 19, like client and server actions, `useOptimistic`, and more. In this demo, we'll start with a client-only React application using Vite and walk through how React 19 simplifies your application logic and helps create a better UX. Then, we'll move to a server framework like Next.js to show how to use React Server Components, Server Actions, and more.

Опубликовано:

 

7 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 68   
@nikilk
@nikilk Месяц назад
For a moment I thought Vercel, made NextJS work with Vite upon reading the title. At the end I was like oh this is more of a migration from Vite. 😂
@relaxwithai
@relaxwithai Месяц назад
Same here... but was a bit skeptical but then I realized it was a video from vercel. Just decided to watch anyway
@parsinta
@parsinta Месяц назад
Same here.
@VercelHQ
@VercelHQ Месяц назад
The first half of the video shows using React 19 features with Vite, like actions and `useOptimistic`, and the second half shows some of the features like server actions, server components, and more with a server framework like Next.js.
@relaxwithai
@relaxwithai Месяц назад
@@VercelHQ It think what some people would think especially with the thumbnail is Next.js is adding vite supports which isn't the case.
@StephenRayner
@StephenRayner Месяц назад
Same here, got excited…
@dimasheiko
@dimasheiko Месяц назад
Simple, but great video. Thanks Lee ❤
@PhilipAlexanderHassialis
@PhilipAlexanderHassialis Месяц назад
Great video Lee! That being said, this is a good example when your application is a small application and you are early in your dev cycle. I would love to see the same exercise (migrating from vite to next) with a big SPA codebase with bighuge redux-toolkit slices, lots of react-router middlewares and loaders and authorizations and whatnot, big react-hook-form forms, the whole shebang and the kitchen sink. Oh, and your API is not in next or JS/TS because of course it's not.
@MrEnsiferum77
@MrEnsiferum77 Месяц назад
Then u will realise how much u love your legacy code.
@LutherDePapier
@LutherDePapier Месяц назад
I need to keep this video in a tab somewhere available at all times. Thanks.
@leerob
@leerob Месяц назад
Glad I could help!
@rust1477
@rust1477 Месяц назад
Great video! Can we please get a followup on unit testing (with jest & react-testing-library) forms that use the action prop?
@MattChinander
@MattChinander Месяц назад
I love the shirt, Lee!
@A41417
@A41417 Месяц назад
Super awesome!
@koekun5817
@koekun5817 29 дней назад
Its really cool!
@drprdcts
@drprdcts 29 дней назад
In vite, how did you set up the GET/POST handlers on the server with such minimal code? Can we get a repo?
@miervaldis42
@miervaldis42 Месяц назад
Actually, question : what is the best way programmatically to know if a component is a "server" one or a "client" one ? (without relying on the fail import error when you try to import hooks in a server component or if the developer uses "use client", for example, I mean) Like is there a way to get Next.js thoughts about a component and then, use it as a boolean to display a message ? Maybe it's a weird question but I was curious ^^"
@danke1673
@danke1673 Месяц назад
typeof window === "undefined"
@lakrib
@lakrib Месяц назад
🤣🤣🤣
@melcooldev
@melcooldev Месяц назад
more like this please
@r-i-ch
@r-i-ch 29 дней назад
Gre@t video! Are there Examples of Error Handling or Cancelled Requests or Debouncing Requests?
@avigdev
@avigdev Месяц назад
When will nextjs 19 be released?
@caresbruh
@caresbruh Месяц назад
lol never thought we would be seeing this
@Ashish_singh_dev
@Ashish_singh_dev Месяц назад
Let's say if the user has made changes in a current page and action saved that change and redirect to some other page where that data needs to be displayed, Will this work? save(someData) revalidatePath("some other page") redirect("some other page")
@marcusmanuh4288
@marcusmanuh4288 Месяц назад
im missing something with the useOptimistic @ 13:40 - how is the `sending` flag getting set back to false? the text conditionally displayed based on that value no?
@alexandereble8179
@alexandereble8179 29 дней назад
When the data is fetched it replaces the optimistic update, consequently doesn't include the send property anymore.
@marcusmanuh4288
@marcusmanuh4288 21 день назад
@@alexandereble8179 ah right thanks!
@TechHorizonUnveiled
@TechHorizonUnveiled 17 дней назад
What VS Code theme does he use?😭
@komariharuto4326
@komariharuto4326 Месяц назад
Sorry for asking this, but what theme are you using for VSCODE?
@leerob
@leerob Месяц назад
One Dark Pro Darker
@komariharuto4326
@komariharuto4326 Месяц назад
@@leerob thank you very much! 😊🙏
@farzadmf
@farzadmf Месяц назад
I was curious about the "with Vite" part, but seems like we removed it altogether from package.json??
@VercelHQ
@VercelHQ Месяц назад
The first half of the video shows using React 19 features with Vite, like actions and `useOptimistic`, and the second half shows some of the features like server actions, server components, and more with a server framework like Next.js.
@farzadmf
@farzadmf Месяц назад
Ah right, it's not possible to use the server-side things with Vite, right?
@IlllIlIlllIIIllIl
@IlllIlIlllIIIllIl 8 дней назад
@@farzadmf Vite also supports SSR. It has a file routing system and is very versatile. There are numerous plugins available, and there is even a plugin that allows the use of RSC.
@farzadmf
@farzadmf 7 дней назад
@@IlllIlIlllIIIllIl Oh wow, thank you; didn't know about that. Are there any links/resources you can share for me to check?
@snivels
@snivels Месяц назад
I think one of the things that is not spoken about with regards to "just fetching it from a server component", is fetching from an external API that requires authentication. I think it's a common enough use case, probably more common than a Next.js app itself interacting with a database, and yet no one ever makes examples.
@spacemanXVI.
@spacemanXVI. 11 дней назад
Thank youuuuu. Its so tiring
@HarleyLam-d6j
@HarleyLam-d6j Месяц назад
Hey, how Next.JS stuffs live without SQL or database features?
@ben53933
@ben53933 29 дней назад
API ?
@HarleyLam-d6j
@HarleyLam-d6j 27 дней назад
@@ben53933 Neat, we have back end teams for those purposes
@mauricenoever
@mauricenoever Месяц назад
Nice video. I have two questions 1. Can I use the optimistic hook without a form and Form action ? I use a simple textarea and on Click it will send a post request over axios to my laravel Backend. 2.When will Turbopack production be ready for next JS production builds ?
@r-i-ch
@r-i-ch 29 дней назад
A textarea is a form component
@LutherDePapier
@LutherDePapier Месяц назад
Basically the db.js file reads, while the actions.js file writes.
@MrEnsiferum77
@MrEnsiferum77 Месяц назад
And that nothing new, I'm writing CQRS software for decades, but finally liberal kids realised...
@rishiraj2548
@rishiraj2548 Месяц назад
👍🏻
@cannotthinkofanybetterhandle
@cannotthinkofanybetterhandle Месяц назад
useOptimistic should be clearing the input fields by default.
@pyquix8576
@pyquix8576 Месяц назад
remix baked into react19 with just a bunch of made up hooks, nice. waiting for rr7
@ttextinction7273
@ttextinction7273 Месяц назад
He's cooking
@leerob
@leerob Месяц назад
let him cook
@olicodes
@olicodes Месяц назад
When will React 19 be released?
@leerob
@leerob Месяц назад
Hopefully pretty soon! Have you been using the RC?
@palmagnusstern1875
@palmagnusstern1875 28 дней назад
When the React team figure out how to handle fallbacks with multiple branches more gracefully!
@yassinebenazouz4529
@yassinebenazouz4529 Месяц назад
just add vite support instead of webpack. it is really annoying to wait 10 seconds evrey time i save changes
@aliventurous
@aliventurous 29 дней назад
Why is it taking 10 seconds to see your changes? I use next and I see changes in about 1 second.
@IlllIlIlllIIIllIl
@IlllIlIlllIIIllIl 8 дней назад
​@@aliventurous If Next.js takes 1 second, Vite takes 100ms (excluding Turbo due to its instability).
@Parmenideano-sp5hl
@Parmenideano-sp5hl 28 дней назад
React > Nextjs
@IlllIlIlllIIIllIl
@IlllIlIlllIIIllIl 8 дней назад
I hope you let go of your obsession with Turbopack. Now that Remix supports Vite, I hope Next.js will too someday.
@ohskynyrdlynyrd
@ohskynyrdlynyrd Месяц назад
чтоооо
@falcon_d3v
@falcon_d3v 18 дней назад
итого просто переделал под nextjs
@rayorole3065
@rayorole3065 Месяц назад
@AdolfRizzler41
@AdolfRizzler41 28 дней назад
At least wait for release lil bro
Далее
10 common mistakes with the Next.js App Router
20:37
Просмотров 200 тыс.
How to build a Recursive React Component
21:16
Просмотров 36 тыс.
I DONT USE NEXT JS
54:01
Просмотров 342 тыс.
Every Framework Sucks Now
24:11
Просмотров 129 тыс.
Giving Up On Next.js | Theo Reacts
44:49
Просмотров 116 тыс.
Next.js vs React - What's the difference?
2:17:57
Просмотров 38 тыс.
Next.js App Router Caching: Explained!
25:22
Просмотров 89 тыс.
Why I still choose next.js
19:39
Просмотров 19 тыс.
React Compiler: In-Depth Beyond React Conf 2024
15:16