Reader small image

You're reading from  Full Stack Web Development with Remix

Product typeBook
Published inNov 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781801075299
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Andre Landgraf
Andre Landgraf
author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf

Right arrow

Adding optimistic UI updates in Remix

In this section, we will review our BeeRich application and discuss which user actions would profit the most from adding optimistic UI updates. Then, we will go ahead and make the required code changes.

Creating an expense

Run BeeRich locally by executing npm run dev in the project’s root and navigate to the expense overview page (http://localhost:3000/dashboard/expenses). Now, create a new expense.

Notice that after submitting the expense creation form, we are redirected to the expense details page. The URL now includes the new expense identifier. After the redirect, we have access to the newly created expense loader data, including the expense identifier. All further updates to the expense require the expense identifier.

Adding optimistic UI updates to the expense creation form may become quite complicated. One way to achieve this would be to optimistically update the look and feel of the creation form so that it looks like...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Full Stack Web Development with Remix
Published in: Nov 2023Publisher: PacktISBN-13: 9781801075299

Author (1)

author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf