Inertia 2 Unleashed
Inertia 2 is now available, and it's packed with new features and improvements. In this series, one topic at a time, we'll take a look at each of these new features. You'll learn about polling, infinite scrolling, deferred props, and more!
Progress
Series Info
- Episodes
- 5
- Run Time
- 1h 7m
- Difficulty
- Intermediate
- Last Updated
- Feb 3, 2025
- Version
- Latest
Series Episodes
- Episodes (5)
Polling
First up on our list is a newusePoll()interface, which allows you to - wait for it - poll your server for updates. This is particularly useful for any application that would benefit from real-time updates.Prefetching
Inertia 2 added support for the newprefetchattribute on your `Link` tags, which allows you to, well, prefetch data for pages that the user is most likely to visit next.Deferred Props
Imagine that you have a piece of data that requires a few seconds to process. Previously, the page load would be hand-cuffed by this long-running task. But now, with deferred props, you can render the component immediately, and then update it once the data is ready.Lazy Loading
What about the situations where you want to delay the loading of a component until it's actually needed? Perhaps, after the user has scrolled the page to the relevant section. With Inertia 2, this is now a breeze.Infinite Scrolling
Now that we understand how to leverage lazy loading using Inertia'sWhenVisiblecomponent, let's take it a step further by introducing another new feature in Inertia 2: prop merging. As it turns out, this is precisely what we need to implement seamless infinite scrolling.
