You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This component uses the same `useRecordContext` hook as the custom `<UrlField>`commponent described earlier.
758
+
This component uses the same `useRecordContext` hook as the custom `<UrlField>`component described earlier.
759
759
760
760
As users can access the post editing page directly by its url, the `<PostTitle>` component may render *without a record* while the `<Edit>` component is fetching it. That's why you must always check that the `record` returned by `useRecordContext` is defined before using it - as in `PostTitle` above.
761
761
@@ -845,9 +845,11 @@ For this tutorial, since there is no public authentication API, we can use a fak
845
845
846
846
The `authProvider` must expose 5 methods, each returning a `Promise`:
847
847
848
-
```jsx
848
+
```js
849
849
// in src/authProvider.ts
850
-
exportconstauthProvider= {
850
+
import {AuthProvider} from"react-admin";
851
+
852
+
exportconst authProvider:AuthProvider= {
851
853
// called when the user attempts to log in
852
854
login: ({ username }) => {
853
855
localStorage.setItem("username", username);
@@ -924,13 +926,13 @@ React-admin calls the Data Provider with one method for each of the actions of t
924
926
The code for a Data Provider for the `my.api.url` API is as follows:
@@ -1040,4 +1042,4 @@ React-admin was built with customization in mind. You can replace any react-admi
1040
1042
1041
1043
Now that you've completed the tutorial, continue your journey with [the Features chapter](./Features.md), which lists all the features of react-admin.
1042
1044
1043
-
**Tip**: To help you close the gap between theoritical knowledge and practical experience, take advantage of the react-admin [Demos](./Demos.md). They are great examples of how to use react-admin in a real world application. They also show the best practices for going beyond simple CRUD apps.
1045
+
**Tip**: To help you close the gap between theoretical knowledge and practical experience, take advantage of the react-admin [Demos](./Demos.md). They are great examples of how to use react-admin in a real world application. They also show the best practices for going beyond simple CRUD apps.
0 commit comments