道具无法识别

问题描述 投票:0回答:0

我不是 React native 的专家,不确定这里有什么问题。有人可以帮助我吗?

type UserInfoProps = {
  getUsername: Promise<string>,
  getDisplayName: Function,
};

export function FetchUserInfo(props: UserInfoProps) {
  console.log("Props:", props)
  // This props is printing as empty

  return (
    // Code to display User details
  )
}

这个 UserInfoProps 在不同的文件中有动作和缩减器。但我不知道出于某种原因,道具打印为空。相同的代码在不同的页面中工作。

javascript reactjs react-native components react-props
© www.soinside.com 2019 - 2024. All rights reserved.