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

Children as text don't display in Text component in React Native

$
0
0

Why does data from GitHub API don't display as children in Text component called StyledDetail, created in styled components? Main screen which renders data is TabOneScreen , UserData in object containing typed user details extracted from GitHub API. childern which I want to display is certain feature of user like id, etc.

Below You can find main component StyledDetail component, and StyledDetailsWrapper.

    import React, { FC } from "react";import { StyledDetailsWrapper, StyledDetail } from "./styles";interface DetailsProps {  selectionColor?: string | undefined;}export const DetailsData: FC<DetailsProps> = ({ children, selectionColor }) => {  return (<StyledDetailsWrapper><StyledDetail selectionColor={selectionColor}>{children}</StyledDetail></StyledDetailsWrapper>  );};    import { View, Text } from "react-native";import styled from "styled-components/native";export const StyledDetailsWrapper = styled(View)`  margin: 10px;  text-align: center;  height: 20px;  width: 100px;`;export const StyledDetail = styled(Text)`  ${(props: { selectionColor: string | undefined }) => props.selectionColor};

here is link to github repo :https://github.com/marcinb1986/database/tree/main/components

Appreciate Your help


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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