Skip to content

[Doc] Impove scrollToTop in buttons doc and document _scrollToTop in useRedirect #10449

Merged
djhi merged 10 commits intomasterfrom
doc/scrollToTop
Jan 22, 2025
Merged

[Doc] Impove scrollToTop in buttons doc and document _scrollToTop in useRedirect #10449
djhi merged 10 commits intomasterfrom
doc/scrollToTop

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

@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

Co-authored-by: Francois Zaninotto <francois@marmelab.com>

## Redirect function

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

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 <1122076+djhi@users.noreply.github.com>
Co-authored-by: Francois Zaninotto <francois@marmelab.com>
Copy link
Contributor

@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

Development

Successfully merging this pull request may close these issues.

3 participants