Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All of the built-in React Native components are wrappers around the corresponding native widgets: https://facebook.github.io/react-native/docs/components-and-...

You can also integrate other native widgets not designed first and foremost for React Native https://facebook.github.io/react-native/docs/native-componen...



Thanks. What's the benefit of using the built-in Button component? The only reason I could see is that you actually want them to look differently on Android and iOS. I've heard the sentiment before but I don't fully understand it. For example, when I build an app I want it to look like my app, with its own distinct graphics, and not like a generic system app. Why go through the hassle of making two different UIs when you can just go with your own?


Games and apps like Snapchat can go that route, making the user learn a completely different UI. But for practically every other app type, going with a new UI and discarding the platform defaults for navigation, buttons, etc. is only going to hurt you in the long run, both from a user perspective (no one has the patience to learn a new UI with every app), and from a effort standpoiont (it takes way longer to develop your own UI than it does sticking with platform defaults).

That has been my experience at least, every time we changed something from "our" way to a more default platform way, we've seen better metrics and retention across the board. We even try to avoid platform specific things like swipe to delete etc., because the general user does not use those features, even if you "teach" them in the onboarding.

This doesn't mean that you shouldn't style your app etc to give it an identity, and there's actually a lot of room you have even when sticking to default elements.


Accessibility is a big one. When your buttons are actual UIButtons, they get treated as such by the iOS accessibility system.

Most developers don't consider accessibility at all because they don't need it themselves. But there are millions of iOS and Android users who do need it, and they might be thankful that you've made their life easier with your app.

Following platform standards makes things easier for users. Users don't care if your app has distinct graphics.


Thanks. Is that's really what's happening with React Native's built-in button though?

https://github.com/facebook/react-native/blob/master/Librari...

    if (color && Platform.OS === 'ios') {
      textStyles.push({color: color});
    } else if (color) {
      buttonStyles.push({backgroundColor: color});
    }
Looks like they are just styling them differently to make them look like system default.


Sorry, I don't know how React Native does it, although my understanding is that Button components do end up as real platform buttons.

Generally speaking, UIButtons have important semantics that are easy to miss if one just reproduces the appearance using custom graphics. The same applies to other standard controls too.


> when I build an app I want it to look like my app, with its own distinct graphics, and not like a generic system app. Why go through the hassle of making two different UIs when you can just go with your own

As a user, I don't want your app to look different from all my other apps. Your app is not special enough (probably). Why go through he hassle of dealing with widgets that look and behave differently all the time, when you can just find a different app that doesn't do that?

Now, I'm not saying that everyone is going to be that irked by it... but it's definitely not an unpopular sentiment.


You have a point but then my whole app will need to look generic. As soon as I add my own elements I will need to start thinking "how will it look with Android button vs iOS button". It's much easier to just add my own button.

I don't think anyone will have a hard time understanding how to press a button just because it looks different than system default.


It depends. Have you ever sat down with an older person and tried to explain to them how tablets work, with them having minimal prior experience with desktop PCs? Of course, that might not be your target audience in any case...

But for the most part, it's not about the difficulty. It's just an eyesore. Kinda like that one house in the neighborhood that has bright red fences, when everyone else has green. It might even be a very pretty bright red, but...


Because users don’t want to have to learn yet another ui. Using the system look and feel means that your app fits in, and the user doesn’t have to learn as much.


It's a button we're talking about. Even a 5-year-old knows how a button works, regardless of looks. What is there to learn?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: