[Doc] Impove scrollToTop in buttons doc and document _scrollToTop in useRedirect #10449
Merged
[Doc] Impove scrollToTop in buttons doc and document _scrollToTop in useRedirect #10449
scrollToTop in buttons doc and document _scrollToTop in useRedirect #10449Conversation
fzaninotto
requested changes
Jan 16, 2025
Comment on lines
-38
to
-45
| // redirect to the result of a function | ||
| redirect((resource, id, data) => { | ||
| return data.hasComments ? '/comments' : '/posts'; | ||
| }, 'posts', 1, { hasComments: true }); | ||
| // redirect to edit view with state data | ||
| redirect('edit', 'posts', 1, {}, { record: { post_id: record.id } }); | ||
| // do not redirect (resets the record form) | ||
| redirect(false); |
Contributor
Author
There was a problem hiding this comment.
To isolate it in their own chapter
Co-authored-by: Francois Zaninotto <francois@marmelab.com>
djhi
suggested changes
Jan 16, 2025
|
|
||
| ## Redirect function | ||
|
|
||
| `useRedirect` allows you to redirect to the result of a function as follows: |
Contributor
There was a problem hiding this comment.
This deserves more examples as you can also return an object as expected by useNavigate
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
fzaninotto
reviewed
Jan 17, 2025
Co-authored-by: Francois Zaninotto <francois@marmelab.com>
fzaninotto
reviewed
Jan 17, 2025
djhi
suggested changes
Jan 20, 2025
Contributor
djhi
left a comment
There was a problem hiding this comment.
I think you missed the <ListButton>
djhi
approved these changes
Jan 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
scrollToTopwith the Algolia search_scrollToTopinuseRedirect's docAdditional Checks
masterfor a bugfix, ornextfor a feature