Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
Align Item Right within container

This is probably a simple answer but I am still learning js / react native and am a bit at a loss.

Could someone explain why the following code fails to right align the "handicap" element?

import React from 'react';
import {View, StyleSheet } from 'react-native'
import AppText from './AppText';

function ListItem({ name, uid, handicap }) {
    return (
        <View style={styles.container}>
            <AppText>{uid}. </AppText>
            <AppText>{name}</AppText>
            <AppText style={{justifyContent: "flex-end"}}>{handicap}</AppText>
        </View>
    );
}

const styles = StyleSheet.create({
    container: {
        flexDirection: "row",
        padding: 10
    },
})

export default ListItem;

I want something like:

  1. Name 5
  2. Name 6

But get

  1. Name5
  2. Name6

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try to add flex: 1 to container style

...
container: {
        flex: 1,
        flexDirection: "row",
        padding: 10
    },
 ...
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!