小编Syl*_*Ain的帖子

在路由上重新渲染 Ionic React(不想重新加载数据)

我正在尝试使用 Ionic React 构建一个应用程序。我的路由器有问题。

应用程序.tsx

<IonRouterOutlet>
         <Route path="/stats" render={() => <Stats/>} exact={true} />
         <Route path="/orders" component={Orders} exact={true} />
         <Route path="/" render={() => <Redirect to="/stats" />} exact={true} /></IonRouterOutlet>  
Run Code Online (Sandbox Code Playgroud)

在我的组件 Stats 中,我使用 useEffect 从 API 加载数据

 useEffect(() => {
   OrdersService.getOrders().then(resultat => {
     setDataOrders(resultat);
    });
     return function cleanup() {
       // Clean the data

     }


  }, []);
Run Code Online (Sandbox Code Playgroud)

如果我转到我的组件 Orders 并返回到 stats,react 不会从 API 重新加载数据。您有什么解决方案可以强制重新加载吗?

提前致谢。

router reactjs ionic-framework react-hooks

5
推荐指数
1
解决办法
1244
查看次数

sql_mode=only_full_group_by

我试图帮助某人在他的代码上实现新功能;但我有这个错误

Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'br_interne.questionnaires_reponses.re_int' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

SELECT `ch_ref` AS id, `ch_date_prevue` AS date, `ch_prestataire_terrassement_branchement` AS prestataire, `re_int` FROM (`questionnaires_contacts`) JOIN `chantiers_osr` ON `ch_ref`=`qc_chantier_id` JOIN `communes` ON `ch_insee`=`co_insee` JOIN `departements` ON `co_departement`=`de_id` LEFT JOIN `questionnaires_reponses` ON `re_questionnaire_contact` = `qc_id` AND re_question = 7 WHERE `de_id` = '78' AND `ch_date_prevue` >= '0000-00-00' AND `qc_chantier_type` = …
Run Code Online (Sandbox Code Playgroud)

php sql codeigniter

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

codeigniter ×1

ionic-framework ×1

php ×1

react-hooks ×1

reactjs ×1

router ×1

sql ×1