-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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] Impove scrollToTop
in buttons doc and document _scrollToTop
in useRedirect
#10449
Conversation
// 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To isolate it in their own chapter
Co-authored-by: Francois Zaninotto <[email protected]>
## Redirect function | ||
|
||
`useRedirect` allows you to redirect to the result of a function as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This deserves more examples as you can also return an object as expected by useNavigate
Co-authored-by: Gildas Garcia <[email protected]>
…o doc/scrollToTop
Co-authored-by: Francois Zaninotto <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you missed the <ListButton>
…ToTop>`
Problem
scrollToTop
with the Algolia search_scrollToTop
inuseRedirect
's docAdditional Checks
master
for a bugfix, ornext
for a feature