Coder Social home page Coder Social logo

Comments (1)

marudy avatar marudy commented on June 1, 2024 1

Hi @bkkwok,

thanks so much for your kind words :-) I am really very glad that you have found this package useful!

Now, about the package methods, I use them myself for almost every attribute in react-native development. There are a couple of cases that you might not need them:

  • When your position style property (bottom, right etc) has a value of 0
  • With property border-radius when I need a big value. I have noticed that if you have border-radius: 250 or border-radius: 25000000000 the visual outcome is the same. But if I need a small value, then I use the package methods.

Now and a bit off topic from your original question I would like to share how I personally use the package methods in some ways that might not be obvious!

  • I always configure my container View component to flex: 1
  • I try to use flex whenever I can
  • I always use widthPercentageToDP and heightPercentageToDP instead of "normal" percentage values, even for 100%. I have noticed that there is a difference which is visible by eye. I haven't searched how RN percentage gets calculated and rendered but it's not 100% accurate in my experience (at least in Android).
  • I have found out that the value 10DP is equivalent with heightPercentageToDP('1.6%') in an average mobile phone. So if you have a project with DP and want to change it to responsive, you can use this analogy as a guide :-)

from react-native-responsive-screen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.