React Native

React Native Styling & Layout

Flexbox, absolute positioning, responsive design, safe area, platform-specific styles

18 gespreksvragen·
Junior
1

What is the default flexDirection in React Native?

Antwoord

In React Native, flexDirection defaults to 'column', unlike on the web where it defaults to 'row'. This means child elements are arranged vertically from top to bottom by default. This difference reflects typical mobile interface conventions, where vertical layouts are more common.

2

How to create a reusable style in React Native?

Antwoord

StyleSheet.create() is the recommended method for creating styles in React Native. It allows defining a style object that can be reused across multiple components. This approach optimizes performance by validating styles once at startup and referencing them by ID rather than recreating objects on each render.

3

Which property to use to center an element both horizontally AND vertically within its container?

Antwoord

To center an element in both axes, combine justifyContent: 'center' (main axis) and alignItems: 'center' (cross axis). With the default flexDirection ('column'), justifyContent centers vertically and alignItems centers horizontally. These two properties work together to achieve perfect centering.

4

What is the default unit of measurement used in React Native for dimensions?

5

Which property allows positioning an element absolutely relative to its parent?

+15 gespreksvragen

Beheers React Native voor je volgende gesprek

Krijg toegang tot alle vragen, flashcards, technische tests, code review-oefeningen en gespreksimulatoren.

Begin gratis