Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/367.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 物料ui V3未加载获取后数据(或页面加载)的第一个选项卡_Javascript_Reactjs_Material Ui - Fatal编程技术网

Javascript 物料ui V3未加载获取后数据(或页面加载)的第一个选项卡

Javascript 物料ui V3未加载获取后数据(或页面加载)的第一个选项卡,javascript,reactjs,material-ui,Javascript,Reactjs,Material Ui,我用的是材料UI版本3,抓取数据后加载选项卡和选项卡容器,但第一个选项卡并没有自动加载到页面加载上,需要点击它查看信息 我在谷歌上搜索过,试图设置这个initialSelectedIndex仍然不起作用,我从那里看到了Github,但没有进一步的信息。 这是 非常感谢 解决componentDidMount中的请求后,您可以获取repo: componentDidMount() { const results = fetch("https://api.github.com/users

我用的是材料UI版本3,抓取数据后加载选项卡和选项卡容器,但第一个选项卡并没有自动加载到页面加载上,需要点击它查看信息

我在谷歌上搜索过,试图设置这个
initialSelectedIndex
仍然不起作用,我从那里看到了Github,但没有进一步的信息。 这是


非常感谢

解决componentDidMount中的请求后,您可以获取repo:

  componentDidMount() {
    const results = fetch("https://api.github.com/users")
      .then(res => {
        return res.json();
      })
      .then(data => {
        //fetch the repos
        this.handleReferences(data[this.state.value].repos_url);
        this.setState({ results: data });
      });
  }

当componentDidMount中的请求得到解决时,您可以获取repo:

  componentDidMount() {
    const results = fetch("https://api.github.com/users")
      .then(res => {
        return res.json();
      })
      .then(data => {
        //fetch the repos
        this.handleReferences(data[this.state.value].repos_url);
        this.setState({ results: data });
      });
  }

很好!!谢谢你的帮助!很好!!谢谢你的帮助!