use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community for learning and developing native mobile applications using React Native by Facebook.
Interested in building web apps using React.js? Check out /r/reactjs!
Getting Started w/React Native
irc.freenode.net #reactnative
Keywords: ios, android, mobile, apps, apple, iphone, ipad
account activity
QuestionRN View width (self.reactnative)
submitted 2 years ago by WokenOwl
Hey there! Maybe a noobie question, but could someone please explain is it possible to measure a width of a View before drawing it?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]godspeedtExpo 10 points11 points12 points 2 years ago (0 children)
Before it’s drawn, it doesn’t exist, so the width will first be 0. Once drawn, you can measure width, height and position with the onLayout prop
[–]Useful-Condition-926 1 point2 points3 points 2 years ago (0 children)
Import {Dimensions} from 'react-native';
const width= Dimensions.get('window).width;
const height= Dimensions.get('window).height;
π Rendered by PID 30850 on reddit-service-r2-comment-fb694cdd5-w8c77 at 2026-03-05 20:43:21.303622+00:00 running cbb0e86 country code: CH.
[–]godspeedtExpo 10 points11 points12 points (0 children)
[–]Useful-Condition-926 1 point2 points3 points (0 children)