Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 915 Bytes

File metadata and controls

25 lines (15 loc) · 915 Bytes
title React

React

npm create feathersdev@latest app --framework react --app-id "<your-app-id>"

Initialization

In your React application, create a src/auth.ts file that allows to make authenticated requests to the backend like this:

This file exports an authFetch function that can be used just like the normal fetch API and will redirect to the login page if the user needs to log in.

Usage

A React component using this function and loading the message from one of the platform example servers can look like this:

You can find the full Vite + React example application here.