首页 > 解决方案 > 以编程方式对本机 this.props 所有值做出反应

问题描述

我的问题很简单。

我想知道所有的钥匙

这个.props

这是我的 React 组件的 react native props

export default class TapBar extends React.Component{
   constructor()
  {
    super();
    this.props.what?
  }
}

有时 this.props 的键是 'a' 或 'b' 或 'navigation'

有时不取决于使用情况。

我怎样才能打印控制台所有这些?

标签: react-native

解决方案


在这里你可以根据你的代码控制台链接这个

export default class TapBar extends React.Component{
       constructor(props)
      {
        super(props);
        console.log(props) // find what you want
      }
    }

推荐阅读