添加计时器功能后画布消失

时间:2020-08-05 08:40:38

标签: reactjs react-three-fiber

enter image description here尝试使用带计时器的反应三纤维开发游戏。我试图基于反应功能创建计时器。问题在于,将计时器包装到场景(游戏过程)中之后,它会覆盖游戏并仅显示计时器。

return (
<Provider store={store}>
  <Router>
    <Fragment>
      <Route exact path="/" component={Landing} />
      <section className="container">
        <Alert />
        <Switch>
          <Route exact path="/register" component={Register} />
          <Route exact path="/login" component={Login} />
          <PrivateRoute exact path="/dashboard" component={Dashboard} />
          <PrivateRoute exact path="/instruction" component={Instruction} />
          <PrivateRoute exact path="/dashboard2" component={Dashboard2} />
          <PrivateRoute exact path="/profile" component={Profile} />
          <PrivateRoute exact path="/intro" component={Intro} />
          <Timer />
          <PrivateRoute exact path="/scene1" component={Scene1} />
          <PrivateRoute exact path="/scene2" component={Scene2} />
        </Switch>
      </section>
    </Fragment>
  </Router>
</Provider>
);

0 个答案:

没有答案