-
Notifications
You must be signed in to change notification settings - Fork 19
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
dialog.transitionComponent prop #47
Comments
Hi @ShaneMasuda, try unboxing and see if it works. |
@Shmew unboxing the return value of the forwardRef function into a ReactElementType? That doesn't seem to work for me, and neither does the following as I get a console error saying the slide component can't read the property 'ref' of undefined. |
I think this will work @cmeeren, @Zaid-Ajaj thoughts on how APIs that need |
@Shmew so I tried that as but it seems the slide component still doesn't know about the ref. Namely, I'm getting the following error: Am I perhaps not using the forwardRef function correctly? Thank you for responding so quickly btw! |
Yeah, you're using it correctly. I'm not really sure you even need it here, you could just try making the element itself and unboxing that, or
You're welcome! |
I just spent some time trying to figure this out, I'm not sure how to fix it right now :(. I could have sworn I already battled this issue before. |
No worries! If any updates happen I'll be here. In the meantime I can work around it by making my own backdrop and making the dialog a child of the slide component. |
@Zaid-Ajaj do you have any input here (see OP)? |
@cmeeren I have no idea, a reproducible example would be nice to see so that we can test what the problem is and compare with how the code looks like in native Mui |
Hey, I run into the same issue. thanks. |
@marcpiechura @Shmew @Zaid-Ajaj coming back to this issue because I found a fix, I created a ReactElementType from scratch and combined the keys and values manually as custom props, which seems to do the trick: The main issue here is that React.forwardRef always seems to yield null for the ref. Please let me know if anything changes! |
What is the proper way to use the transitionComponent prop for dialogs? The Material UI documentation uses the forwardRef function as
const Transition = React.forwardRef(function Transition(props, ref) {
return <Slide direction="up" ref={ref} {...props} />;
});
but the Feliz.React.forwardRef function returns a ReactElement rather than a ReactElementType. Is there an additional function call required to convert from ReactElement to ReactElementType, or is there a simpler way to go about this?
The text was updated successfully, but these errors were encountered: