Loading UI with Next.js 13 and React Suspense

Loading UI with Next.js 13 and React Suspense

Vercel

1 год назад

202,510 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Руслан
Руслан - 20.11.2023 11:34

Thx!!! That's what I've been looking)

Ответить
Guido Wagner
Guido Wagner - 09.10.2023 22:31

what if I am using pages routing within a nextjs 13 project, is loading.js available?

Ответить
Yaroslavzef
Yaroslavzef - 29.08.2023 08:30

For a long time I could not understand why loader does not work. It turned out my data was in the cache!

Ответить
Martin Vega
Martin Vega - 28.08.2023 18:48

do you have the repo only for example

Ответить
Ramiz Khan
Ramiz Khan - 14.07.2023 15:57

loving the way loading works. You just create a new file with loading and booms done.....

Ответить
27sosite
27sosite - 10.07.2023 19:27

why on earth not to use mouse
this is so funny to watch this "hackers"

Ответить
La 25ème Image
La 25ème Image - 25.06.2023 18:17

Thanks, but you are in local development right? It means the fetch happens at every request.
But in production, you will not see it I belive right?

Ответить
La 25ème Image
La 25ème Image - 25.06.2023 17:33

Thank you!
How to implement a "See more" button behaviour with a next js server component ?

Ответить
。ふろ
。ふろ - 20.06.2023 22:49

Sadly there's no way to show any feedback when executing a server action, and the data is being streamed. It seems it's not possible to add hooks to the streaming life-cycle.

For example, if I have a list of users, execute a server action for "adding a user" (which executes revalidatePath), then I can show a loading spinner during the duration of the action, but once the action is done, the spinner will disappear, and there's no way to know when the new data will arrive (which can be several seconds after the spinner disappeared).

Ответить
supalarry100
supalarry100 - 14.06.2023 15:00

this is amazing

Ответить
nested
nested - 11.06.2023 00:03

if u follow this approch and the add the new post the data will not show instantly : unfortunately

Ответить
KD STUDIO GAMES
KD STUDIO GAMES - 31.05.2023 19:46

i need help with loading state. can someone help with me?

Ответить
The Chronic Grump
The Chronic Grump - 29.05.2023 23:56

So all I have to do is add in a loading.tsx? I don’t have to wrap the layout in anything?

Ответить
Spencer Bigum
Spencer Bigum - 14.05.2023 21:04

Amazing technology. For Seo, will the list of posts be empty when a google bot crawls it? If I want the posts to be available for the google bot crawlers do I still need to do a static page?

Ответить
CodewithGuillaume
CodewithGuillaume - 08.05.2023 16:58

Amazing video thanks so much.

Ответить
Alejandro Loayza
Alejandro Loayza - 27.04.2023 18:25

Thank you. But loading works only during render SSR files. But if i'm using client side properties for change status of certain elements and during refresh or first load it shows all unstyled elements till all page has been loaded, and my loading page doesn't work. Do you have some advice please?

Ответить
Nadya Shaymardanova
Nadya Shaymardanova - 25.04.2023 14:41

👯

Ответить
Mehdi HS
Mehdi HS - 13.04.2023 06:55

Hi, i can't use loading.js in subfolder(for components)
please add this option
with this option we can make different loadings for each component

Ответить
Nadya Shaymardanova
Nadya Shaymardanova - 11.04.2023 15:21

💕 💞

Ответить
Kim
Kim - 08.04.2023 23:52

Really cool, but I still prefer to use nprogress. Makes it better for users to see loading progress

Ответить
KaKun
KaKun - 05.04.2023 14:36

so no conditional checking for isLoading or error state? can we just call the api with no try catch a bit confused

Ответить
Chris Reynoso
Chris Reynoso - 24.03.2023 17:28

Do you have to be using the new app directory for this? It's not working on my project but I am not using the app directory since they say that it's still not production ready.

Ответить
Vedant
Vedant - 13.03.2023 14:25

What's better than solider boy teaching us Next.js.

Ответить
Yasya Indra
Yasya Indra - 02.03.2023 06:46

thank u this is very usefull

Ответить
Chris Hayes
Chris Hayes - 01.03.2023 07:16

We have arrived at 2014 Ember.js… fitting that Sam is presenting!

Ответить
MightNight
MightNight - 26.02.2023 11:59

Damn, this stuff is amazing. I think we're finally settling down with the hybrid applications & awesome UX.

Ответить
Jannik Bertram
Jannik Bertram - 25.02.2023 23:05

Great video! Could you by any chance share the code for this example? Would appreciate it!

Ответить
BullPasha
BullPasha - 21.02.2023 00:16

First of all, great voice... but, I am very confused about this. This is what it says in the docs "Good to know: Previous Next.js data fetching methods such as getServerSideProps, getStaticProps, and getInitialProps are not supported in the new app directory." so how are we able to use that here under the app dir?

Ответить
FLYTIM
FLYTIM - 16.02.2023 01:17

Does the SSR-Route work without enabled JavaScript with that new Next 13 approach?

Ответить
Sidik Riders
Sidik Riders - 14.02.2023 21:34

when use loading.tsx, does the SEO crawler can get the post content?

Ответить
Coding in Flow
Coding in Flow - 12.02.2023 00:14

I actually prefer a progress bar on the top of the page over this, which works with the "old" approach as well.

Ответить
fieryscorpion
fieryscorpion - 09.02.2023 02:58

You JS devs need to give Blazor a try.
Writing web apps front to back in a statically typed language is a dream come true.

Leave this mess and come to the better side. 🤗

Ответить
Arai Junior
Arai Junior - 08.02.2023 11:29

power!!

Ответить
Rayhan Islam
Rayhan Islam - 08.02.2023 07:10

So how to reuse this loading file? like as React? is it possible here?

Ответить
Ala GARBAA - 🚀 Engineer
Ala GARBAA - 🚀 Engineer - 06.02.2023 19:55

I actually tested and i will use it on my personal web.
Thank you.

Ответить
Ismoil Shokirov
Ismoil Shokirov - 05.02.2023 09:19

Wow that's super cool ❤

Ответить
Jonas Jacobs
Jonas Jacobs - 04.02.2023 14:59

Can we get the full className of the span element, the loading animation looks great! Thanks

Ответить
Tuấn Anh
Tuấn Anh - 03.02.2023 12:17

Nice sound

Ответить
Phojie
Phojie - 02.02.2023 09:50

i cant believe this is new to next, while nuxt have this 3years ago

Ответить
INFO HARIAN
INFO HARIAN - 02.02.2023 05:25

im just thinking, about if we have multiple load data, we need also 1 by 1 loading state on each section.
do we need to copy and paste the template or any magic things to do it ?

Ответить
Marlon Marcello
Marlon Marcello - 31.01.2023 02:11

Nice clean explanation, thank you! Any chance you could show us how to integrate these features with Framer Motion for some sleek page-loading-page transitions @samselikoff ?

Ответить
Md Azim Babu
Md Azim Babu - 29.01.2023 09:14

When to use getstaticprops and Async function ? I am building my pages in Page Folder not in App folder

Ответить
Chester XP
Chester XP - 29.01.2023 00:30

GoodJob!

Ответить
mohammed ahmed
mohammed ahmed - 28.01.2023 10:34

so sick

Ответить
Abdo Alsayed
Abdo Alsayed - 27.01.2023 17:04

Inspired by remix

Ответить
Quân Nguyễn
Quân Nguyễn - 27.01.2023 16:41

I don't see any step that you use Loading component with Suspense causes a little bit confused here

Ответить
CraftedGadgetMC
CraftedGadgetMC - 25.01.2023 19:27

I thought getServerSideProps, getStaticProps, getStaticPaths are gone.

Ответить
Borna Pavlić
Borna Pavlić - 25.01.2023 14:22

Could you share repo?

Ответить
Torsten
Torsten - 24.01.2023 12:52

It was quite easy to make a loading indicator with next 12 by utilizing `router.events.on('routeChangeStart' | 'routeChangeComplete')`. This loading indicator would not replace the whole content instantly. I think the solution presented here is a worse UX.

Is there a way to have the same effect in a next 13 app directory? The router you get from the `useRouter` hook of "next/navigation" has no events.

Ответить