1. 4
    Layout React Native Components with Flexbox
    3m 48s

Layout React Native Components with Flexbox

InstructorChris Achard

Share this video with your friends

Send Tweet

React Native uses Flexbox to layout most components, which makes it easy to run your app on devices of many different screen sizes. We’ll learn the basics of Flexbox in React Native, and how to use it to build a flexible screen layout. We’ll also look at some differences between flexbox on the web and on mobile.

Calvin Lewis
~ 5 years ago

Why is it necessary to have the braces around restaurants.map() ?

Chris Achardinstructor
~ 5 years ago

We're inside of JSX there, so in order to run javascript inside of JSX, you have to wrap it in { }. If you didn't wrap it, JSX would think you were trying to display text (outside of a text block, so it would cause an error in this case)

George
~ 5 years ago

Is that any javascript? When i move the restaurants array inside the {} i get unexpected token error.

Chris Achardinstructor
~ 5 years ago

@George: I'm not sure I fully understand what gave you the error; could you give a code sample?