Using React 19 with Vite and Next.js

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

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. 😂

nikilk
Автор

I need to keep this video in a tab somewhere available at all times. Thanks.

LutherDePapier
Автор

just add vite support instead of webpack. it is really annoying to wait 10 seconds evrey time i save changes

yassinebenazouz
Автор

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.

PhilipAlexanderHassialis
Автор

Great video! Can we please get a followup on unit testing (with jest & react-testing-library) forms that use the action prop?

rust
Автор

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 ^^"

miervaldis
Автор

Simple, but great video. Thanks Lee ❤

dimasheiko
Автор

In vite, how did you set up the GET/POST handlers on the server with such minimal code? Can we get a repo?

flexdash
Автор

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")

Ashish_singh_dev
Автор

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?

marcusmanuh
Автор

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.

snivels
Автор

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 ?

mauricenoever
Автор

I was curious about the "with Vite" part, but seems like we removed it altogether from package.json??

farzadmf
Автор

Sorry for asking this, but what theme are you using for VSCODE?

komariharuto
Автор

Basically the db.js file reads, while the actions.js file writes.

LutherDePapier
Автор

useOptimistic should be clearing the input fields by default.

cannotthinkofanybetterhandle
Автор

Hey, how Next.JS stuffs live without SQL or database features?

HarleyLam-dj
Автор

lol never thought we would be seeing this

caresbruh
Автор

remix baked into react19 with just a bunch of made up hooks, nice. waiting for rr7

pyquix