Skip to content

Commit b1f40d2

Browse files
Apply suggestions from code review
Co-authored-by: adrien guernier <adrien@marmelab.com>
1 parent 3c0ce59 commit b1f40d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/IfCanAccess.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ To display the `ExportButton` in a `CompanyList` component, you would use:
7676

7777
## `resource`
7878

79-
By default, `<UseCanAccess>` uses the current resource (from the `ResourceContext`) to check permissions. You can override this behavior by passing the `resource` prop:
79+
By default, `<IfCanAccess>` uses the current resource (from the `ResourceContext`) to check permissions. You can override this behavior by passing the `resource` prop:
8080

8181
```jsx
8282
<IfCanAccess action="export" resource="companies">
@@ -135,7 +135,7 @@ export const PostCreate = () => (
135135

136136
**Tip**: This example uses a `Navigate` component to redirect to a custom page because you cannot use a `Redirect` component in this context. The `IfCanAccess` component uses a render prop, and `Redirect` only works in the render method of a component.
137137

138-
Note that you if you use the `fallback` prop for a CRUD page (Create, Edit, List, Show) as above, you must use the `<Resource>` component from `react-admin` rather than the one from `ra-rbac`. This is because `ra-rbac` already does the access control check, and would redirect to the Not Found page before the fallback component is rendered.
138+
Note that if you use the `fallback` prop for a CRUD page (Create, Edit, List, Show) as above, you must use the `<Resource>` component from `react-admin` rather than the one from `ra-rbac`. This is because `ra-rbac` already does the access control check, and would redirect to the Not Found page before the fallback component is rendered.
139139

140140
```tsx
141141
// In src/App.tsx

0 commit comments

Comments
 (0)