Replies: 3 comments 4 replies
-
Amazing work, thanks @ancyrweb 👏 I'm also pinging a few people that have been interested in discussing this topic in the past: @nandorojo @RichardLindhout @ChristianTucker @theohdv @Titozzz First of all, here's some historical context on how we got to this point — so that hopefully we won't make the same mistakes again 🥲 Regarding the discussion, here's my feedback. I 100% agree with the introuduction/pain-points you mentioned. One thing I want to highlight, though, is that I think we should also solve the main issue RNM users are directly experiencing: bugs and edge cases caused by React-Native's built-in Modal component (as discussed in #597)
I'll think about it. Supporting everything we do support now would be great, but doing so while providing a nice, modular API could take quite a while. I'm mostly curious about how we'll end up "hooking" the plugins into the modal lifecycle/ui/behaviour.
Hot take: we shouldn't strive for backward compatibility because, at the current state, the modal component hasn't been updated in months/years. I think slowing down the development of "v2" because of backward compatibility would have made sense only if "v1" was still actively being supported and maintained (which is not the case).
Easy yes from me here 👍
Sounds good. Something to keep in mind here though: the modal code won't ever be "simple" even for default cases if we plan to expose hooks into its behaviour/lifecycle/ui accessible thorugh plugins.
Yes 👍
I think we should build the animation plugin in-house and using the
Looks similar to what we're doing in React-Native-Dialog (but I guess it's a common pattern nowadays?) |
Beta Was this translation helpful? Give feedback.
-
Fyi, I've been using reanimated + portals to create my own modals and I'm not looking back. The OG modal from react native is way too buggy and doesn't even support multiple. I do believe, nowadays that it's quite easy to implement your own modal with reanimated. If interested I can ask if I can share some code with you guys. |
Beta Was this translation helpful? Give feedback.
-
@mmazzarolo drafted something here https://github.com/ancyrweb/react-native-modal-v2/ |
Beta Was this translation helpful? Give feedback.
-
Introduction
As a maintainer of this package, it has become obvious the code is difficult to maintain.
Goal
The goal of this RFC is to discuss a complete rewrite of the modal package.
Here are the requirements, I believe, should be kept in our mind while moving forward.
Going forward, we might even consider embed native code and manage the modal responsibility altogether (as part of the Lean Core effort)
Ideas
Here are the main ideas I've thought of :
Proposal
This part is still being studied.
Here's an example of what this ideal world would look like.
In this draft, we're using children as a way to add behaviour to the modal.
Modal.Backdrop
children. We can also provide a way to render a custom backdrop and pass it the props, so the user can customize it.Modal.Content
to differentiate from other components (and allow for specific customization/hooking from plugins). I believe theModal.Content
component (aka theContent Renderer
) will be primordial for plugin interaction.Beta Was this translation helpful? Give feedback.
All reactions