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

159
Views
render list of item from array by gerParam() - react native

I would like to create a list from an array using getParam (transfer data between screens). The end result should look like this:

  • Wiosła
  • Deska
  • Podciąganie

now I'm using Text, probably it can be work by FlatList (but nothing is displayed)

code:

import React, {useState} from "react";
import { Button, StyleSheet, Text, View, Pressable, FlatList, TouchableOpacity } from 'react-native';
import { globalStyles } from "../styles/global";


export default function PlanList({navigation}){
    
    const [training, setTraining] = useState([
        { title: 'Trening pleców', body: ['wiosła', 'deska', 'podciaganie'], key: '1' },
        { title: 'Trening brzuch/uda/pośladki', body: ['odwodzenie', 'krab', 'martwy ciąg'], key: '2' },
        { title: 'Trening ręce+klatka', body: ['rozpiętki', 'przyciąganie do skroni', 'bicek'], key: '3' },
      ]);


    return(
        <View style={globalStyles.container}>
                <Text>Ułóż swoje bloki treningowe</Text>
                <Pressable><Text>Dodaj nowy</Text></Pressable>

                <FlatList
                data={training}
                renderItem={({item}) => (
                    <TouchableOpacity style={globalStyles.trainingGrup} onPress={() => navigation.navigate('Training', item)}>
                            <Text>{item.title}</Text>
                    </TouchableOpacity>
                )}
                ></FlatList> 
        </View>
    )
}
import React from "react";
import { StyleSheet, View, Text, Image, FlatList } from "react-native";
import { globalStyles , images} from "../styles/global";


export default function Training({navigation}){
    return(
        <View style={globalStyles.container}>
                <Text>
                {navigation.getParam('body')}
                </Text>
        </View>
    )
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you can access the data in the Training screen

you should declare a const

const { title } = route.params;

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!