Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6290

react-native: how to validate flatlist of input?

$
0
0

I have a list of products and everyone has 2 inputs.

I want to validate that user filled all inputs with the correct values.

the screen Code:

const renderClients = ({ item }: any) => (<ProductItemComponent product={item} />)const UnloadScreen: FC = (): ReactElement => {    return (<SafeAreaView style={{ flex: 1 }}><View style={{ height: 40, flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>                {/* <Text style={{flex: 2.5, textAlign: 'center'}}>Product Image</Text> */}<Text style={{ flex: 4, textAlign: 'left', paddingLeft: 10 }}>Product</Text><Text style={{ flex: 1, textAlign: 'center' }}>packing Quantity</Text><Text style={{ flex: 1, textAlign: 'center' }}>atomic Units</Text></View><FlatList                data={ProductListDB}                renderItem={renderClients}                keyExtractor={(item, index) => index.toString()}            // refreshControl={            //  <RefreshControl refreshing={refreshing} onRefresh={onRefresh} />            // }            /></SafeAreaView>    );}export default UnloadScreen;Ï

a screenshot:

enter image description here


Viewing all articles
Browse latest Browse all 6290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>