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
Copy file name to clipboardExpand all lines: docs/Architecture.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -278,7 +278,7 @@ Communicating between components is a common problem in React applications, espe
278
278
279
279
Whenever a react-admin component fetches data or defines a callback, the component creates a context and puts the data and callback in it.
280
280
281
-
For instance, the `<Admin>` component creates an `I18NProviderContext`, which exposes the `translate` function. All components in the application can use the `useTranslate`hok, which reads the `I18NProviderContext`, to translate their labels and messages.
281
+
For instance, the `<Admin>` component creates an `I18NProviderContext`, which exposes the `translate` function. All components in the application can use the `useTranslate`hook, which reads the `I18NProviderContext`, to translate their labels and messages.
282
282
283
283
```jsx
284
284
import { useTranslate } from'react-admin';
@@ -298,7 +298,7 @@ import { useRecordContext } from 'react-admin';
@@ -326,6 +326,8 @@ This simple approach removes the need for a dependency injection system.
326
326
327
327
So when you write a component that need to access data or callbacks defined higher in the render tree, you can always find a context to get it.
328
328
329
+
Contexts are one of the key concepts in React Admin. If you are not familiar with them, do not hesitate to read the [React documentation on Context](https://react.dev/learn/passing-data-deeply-with-context).
0 commit comments