Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Add disableAuthentication prop description on <Show> component #8565

Merged
merged 2 commits into from
Jan 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/Show.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ That's enough to display the post show view:
* `className`: passed to the root component
* [`children`](#layout): the components that render the record fields
* [`component`](#component): overrides the root component
* [`disableAuthentication`](#`disableauthentication`): disable the authentication check
* [`emptyWhileLoading`](#loading-state)
* [`queryOptions`](#queryoptions): options to pass to the react-query client
* [`sx`](#sx-css-api): Override the styles
Expand Down Expand Up @@ -236,6 +237,20 @@ const PostShow = props => (
```
{% endraw %}

## `disableAuthentication`

By default, the `<Show>` component will automatically redirect the user to the login page if the user is not authenticated. If you want to disable this behavior and allow anonymous access to a show page, set the `disableAuthentication` prop to `true`.

{% raw %}
```jsx
const PostShow = () => (
<Show disableAuthentication>
...
</Show>
);
```
{% endraw %}

## `sx`: CSS API

The `<Show>` component accepts the usual `className` prop but you can override many class names injected to the inner components by React-admin thanks to the `sx` property (as most MUI components, see their [documentation about it](https://mui.com/customization/how-to-customize/#overriding-nested-component-styles)). This property accepts the following subclasses:
Expand Down