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

Warning weird: is declared but its value is never read

$
0
0

This is my code:'Skeleton' is declared but its value is never read.

import React from 'react';import {    FlatList, View, StyleSheet} from 'react-native';// But warning here import { Skeleton, Colors } from '@momo-platform/component-kits';const SkeletonLoadingChat = () => {    const data = [1, 2, 3, 4, 5, 6, 7, 8, 9];    return (<FlatList            style={{ padding: 15 }}            data={data}            ListHeaderComponent={() => {                return (<View style={styles.headerSkelation}><View style={styles.avataSkelation} /><View style={styles.lineSkelation} /></View>                );            }}            renderItem={({ item, index }) => {                return (                    // I used Skeleton here<Skeleton.Custom                        left={<Skeleton.Media size={52} />}                        style={styles.skeletionItem}><Skeleton.Line style={styles.width_1_9} /><Skeleton.Line style={styles.width_80} /></Skeleton.Custom>                );            }}        />    );}

enter image description here

I used Skeleton but it still shows a warningInterface Skeleton

export interface Skeleton extends SkeletonProps {  Line?: React.ReactElement,  Media?: React.ReactElement,  Custom?: React.ReactElement,}

If I remove import Skeleton it shows errorenter image description here


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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