Skip to content

Fix passing an element to notify requires to wrap it in forwardRef - #10935

Merged
Madeorsk merged 2 commits into
masterfrom
fix-custom-notification-requires-forward-ref
Sep 12, 2025
Merged

Madeorsk merged 2 commits into
masterfrom
fix-custom-notification-requires-forward-ref

Conversation

@djhi

@djhi djhi commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Problem

Even though our story does it, our documentation does not mention that you have to wrap your notification element in a forwardRef.

We could fix the documentation but requiring our users to think about this isn't great.

Solution

  • Wrap the element inside a div in the default Notification component.
  • The tests should still pass

The wrapping div does not even appear in the DOM.

How To Test

  • The story still works without forwardRef.

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@djhi djhi added the RFR Ready For Review label Sep 12, 2025
@Madeorsk
Madeorsk self-requested a review September 12, 2025 13:03
@Madeorsk
Madeorsk merged commit 4b6692b into master Sep 12, 2025
@Madeorsk
Madeorsk deleted the fix-custom-notification-requires-forward-ref branch September 12, 2025 13:42
@Madeorsk Madeorsk added this to the 5.11.2 milestone Sep 15, 2025

This branch was successfully deployed

1 active deployment
Preview – react-admin-storybook — 0c716bba Deployed Sep 12, 2025 by vercel[bot]
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.

2 participants