動画検索
関連広告
検索結果
Intro
Welcome
SWR Explained
Starter Code
Install SWR
json-server
Axios API layer
Imports
useSWR hook
SWR mutate function
What is a mutation?
Check the CRUD operations
Adding some delay
Viewing stale data until success or fail
SWR 2.0 Preload data
Benefits of Optimistic UI updates
Refactor to Optimistic UI
Helper functions
Import the helpers
Mutate with Optimistic UI
Checking the Optimistic UI
A Challenge for You
Intro
What is SWR or Stale While Revalidate?
Setup
Setup the fake mock backend
Old way of fetching data from server in react
First SWR query using useSWR hook
Create fetcher function
SWRConfig provider
Global config
Create first query function
Chained or dependable queries
Mutations (life cycles, callbacks, ...)
useSWRMutation
Passing data to mutations function and trigger
Optimistic UI and data
RollBackOnError
Middlewares
Pagination
Infinite scrolling (useSWRInfinite)
Intro and what is SWR?
Starting the Tutorial - Setting Up
Installing SWR and Setting Up a Fetcher Function
Fetching data from a Public API
Rendering a List of Posts
Making Data Fetching Logic Reusable
Using a Custom Hook to Fetch User Data
Extracting posts to a separate screen
Configuring SWR Globally
Creating Mutations; Optimistic Updates
SWR Error Handling
Fetching GraphQL APIs & React Native Specific Configuration
Handling App Focus Events
Outro
Introduction
Creating the foundation
Adding SWR
Creating a custom fetcher
Built in data and error handling.
Creating a loading and error screen.
Using Map to create a list of users.
Trying out data fetching.
What is happening in the console
Stop fetching on focus.
Adding revalidateOnFocus
Testing our new code.
Adding a button to add data.
Async onClick Handler
Posting Data to our API
Testing the POST
No data refresh
Adding Mutation
Testing Mutation
Outro
Introduction to the video
Introduction to s SWR library and its benefits
Explanation of the app directory structure in NEX js14
Setting up a client component within the app directory
Installing the s SWR package
Creating a client component for the dashboard page
Defining the fetcher function for fetching data from an API
Handling error and loading states in the client component
Returning the actual content once the data is available
Accessing the dashboard page in the browser
Explaining the caching behavior of S SWR
Creating a separate card component to demonstrate caching
Loading the card component on button click
Handling the button click event and updating the card state
Displaying the card component based on the card state
Showing the difference between using and not using S SWR
Implementing the S SWR provider component for global settings
Wrapping the components with the S SWR provider
Testing the application with the S SWR provider
Success message indicating successful implementation of S SWR
Introduction to other features of S SWR like mutations and infinite loading
Closing remarks and summary of the video