Giter Club home page Giter Club logo

Comments (6)

jeremywiedemeier avatar jeremywiedemeier commented on July 29, 2024 1

@moblizeit

Remove your width propety and use calcWidth. calcWidth is a property like width, but instead of taking in a number, it takes in a function that returns a number (the dynamically-generated width). Here's an example:

calcWidth={(size) =>
            size.screenWidth > maxWidth &&
            size.screenHeight > maxWidth
              ? maxWidth
              : Math.min(size.screenWidth, size.screenHeight)
          }

The input parameter is size (which comes with screenWidth and screenHeight) and the output parameter is the width; in this case, it's the smaller of screenWidth or screenHeight below maxWidth.

from chessboardjsx.

willb335 avatar willb335 commented on July 29, 2024

Use the calcWidth prop instead of the width prop

from chessboardjsx.

moblizeit avatar moblizeit commented on July 29, 2024

example to do that? i am using it in a react native app and not sure what should be the value for this property

from chessboardjsx.

agam-colaburate avatar agam-colaburate commented on July 29, 2024

Hi @willb335 @jeremywiedemeier @moblizeit
Any working react native example for chessboardjsx ?
Is it good to use this library in react native ?

from chessboardjsx.

willb335 avatar willb335 commented on July 29, 2024

@agam-colaburate

Not sure this can work within a webview for react native. Sorry no mobile examples

from chessboardjsx.

singhagam1 avatar singhagam1 commented on July 29, 2024

I guess Webview wont be a good option because we won't have any control over it, Thanks for replying though !

from chessboardjsx.

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.