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

Whisper component: must be made clear that the 'children' prop must support ref prop through React.forwardRef #2640

Open
lfa9603 opened this issue Aug 3, 2022 · 3 comments

Comments

@lfa9603
Copy link

lfa9603 commented Aug 3, 2022

Whenever a custom component is used as Whisper children, the custom component must support referencing using forwardRef.
While it's clear that the speaker component must do so, it can't be said the same about the children prop.

Hence, I propose we add a few lines specifying that custom components that are used as Whisper children must be of type RsRefForwardingComponent<,> or any other component type that is aware of the ref prop.

@simonguo
Copy link
Member

simonguo commented Aug 3, 2022

There is a description of this issue in the documentation
https://rsuitejs.com/guide/composition/#caveat-with-refs

@lfa9603
Copy link
Author

lfa9603 commented Aug 3, 2022

Awesome thanks, I would suggest we add a line at the beginning of the Whisper docs mentioning Whisper children prop having to conform to the mentioned caveat. I am happy to open a Pull Request for it if this sounds reasonable.

@simonguo
Copy link
Member

simonguo commented Aug 4, 2022

You are welcome to submit PRs to improve rsuite components and documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants