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] Impove scrollToTop in buttons doc and document _scrollToTop in useRedirect #10449

Merged
merged 10 commits into from
Jan 22, 2025

Conversation

erwanMarmelab
Copy link
Contributor

Problem

  • We can't find scrollToTop with the Algolia search
  • domument _scrollToTop in useRedirect's doc

Additional Checks

  • The PR targets master for a bugfix, or next for a feature
  • The documentation is up to date

Sorry, something went wrong.

@erwanMarmelab erwanMarmelab added the RFR Ready For Review label Jan 15, 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);
Copy link
Member

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?

Copy link
Contributor Author

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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Francois Zaninotto <[email protected]>
## Redirect function

`useRedirect` allows you to redirect to the result of a function as follows:
Copy link
Collaborator

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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Gildas Garcia <[email protected]>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Francois Zaninotto <[email protected]>
Copy link
Collaborator

@djhi djhi left a 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>

@djhi djhi added this to the 5.5.1 milestone Jan 22, 2025
@djhi djhi merged commit 17407ad into master Jan 22, 2025
16 checks passed
@djhi djhi deleted the doc/scrollToTop branch January 22, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants