-
Notifications
You must be signed in to change notification settings - Fork 264
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
feat: add a ios native module to calculate inset top and bottom #511
base: main
Are you sure you want to change the base?
feat: add a ios native module to calculate inset top and bottom #511
Conversation
hey @seyedmostafahasani, thanks again! I'm just thinking: could we do it in some way that doesn't involve adding a 3rd party dependency? Adding I suggest either:
wdyt? |
Hey Calin, |
@seyedmostafahasani looking good, thanks! I'll run a few tests in a demo app that I use and then we can merge. Will probably require a major bump, since it's a breaking change for installation. |
Anytime! I agree with you about a major bump. Great! |
@calintamas Did you have time to test my PR? |
hey, I did not manage to take a look yet. will try today |
@seyedmostafahasani Took a quick look, and everything looks fine! I just need some time to prepare the new readme for v3, with release notes migration docs, etc. I published the change as yarn add [email protected] |
I can help you if you need anything. |
Hey Calin, Have you had enough time to release a new version of the library? |
Ah, not really :) Winter vacation and all that, I'll get back to it soon |
@calintamas Hey Man, |
Does the native module work fine with Expo, or we need ajustments? I wanted to have this checked, but really had no time to do it. |
Hey Man, |
Hey @calintamas |
If you need anything let me know. I'm available 🤝 |
Hey! I kept thinking if it's worth having a native module (only) for this after all... I'm leaning towards the other solution I proposed back then -- some good-enough (hardcoded) defaults, with the already existing A native module means: (1) more maintenance work down the road (with the new RN architecture), (2) potential issues for Expo users (which I don't have time to take care of, since I'm not actively using Expo). I probably should have expressed my concerns earlier. I don't want to dismiss the work you did in any way, I just prefer solutions that are simpler to maintain in the long-term. Thanks for understanding! |
Thank you for your attention. I am available to manage the library and address any issues related to this native module. Please don’t worry about it. We can release a new version with these changes to the native module. Additionally, many of my friends have used the beta version in various projects, and none of them have encountered any issues with native modules. |
We also haven't removed the default variables |
I understand your point. What I mean is that I don't think the native module is really necessary in this case (along with the reasons mentioned above, it brings a breaking change which I prefer to avoid). If anyone needs custom values, it's relatively easy to do even right now: import { Toast } from 'react-native-toast-message'
const App = () => {
const insets = useSafeAreaInsets()
return (
<Toast
// ...
topOffset={insets.top}
bottomOffset={insets.bottom}
/>
)
} I'd rather have some better default values (trading correctness for simplicity). It's a difference in the approach, nothing else. |
I understand your point. This way is good, but we can do it easier for all users with these changes. They don't need to install 3rd-party library. |
I used
react-native-safe-area-context
to handle it.