i am using ionic react and struggling on how to use calcWidth to get the width dynamically. Currently i am using something like below
width={310}
which gives 310 px in my react component i am using. the documentation suggest to use calcWidth but does not explain how. I see some examples to use Dimensions but seems i could not use that with ionic react.
i tried plain
width={calcWidth}
but that does not work as it will need the width property.
Well you can obtain the screen width by using the window:
window.innerWidth
2.1m questions
2.1m answers
60 comments
57.0k users